/* Advertise (v1.27): the "Hire the Heralds" page, the side tower's Advertise panel and the Deposit / Transfer popups.
   Glyph colours for the campaign actions: stats orange, add clicks light blue, play/pause green, delete red. */
:root{--ad-orange:#f2a24a;--ad-blue:#7cc8f2;--ad-green:#62d394;--ad-red:#e8705d}
:root[data-theme="light"]{--ad-orange:#b8600e;--ad-blue:#1f78ad;--ad-green:#1d7a46;--ad-red:#b3261e}

/* ---------- the page ---------- */
.ad-balrow{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:20px;padding:14px 16px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.ad-balrow img{width:30px;height:30px;border-radius:50%;box-shadow:0 0 0 1px rgba(244,221,148,.5)}
.ad-bal{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.ad-bal strong{font-family:var(--mono);font-weight:500;font-size:1.5rem;color:var(--gold-hi)}
:root[data-theme="light"] .ad-bal strong{color:var(--gold)}
.ad-bal small{font-size:.76rem;color:var(--muted)}
.ad-balrow .ad-btns{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
.ad-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:26px}
.ad-head h2{display:flex;align-items:baseline;gap:10px}
.ad-head .label{font-family:var(--body)}
#adMsg{margin-top:10px}
#adMsg:empty{min-height:0}

/* the create form */
.ad-form{margin-top:18px;padding:18px;border:1px solid var(--gold);border-radius:10px;background:var(--bg);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px 16px}
.ad-form .wide{grid-column:1/-1}
.ad-form h3{grid-column:1/-1;font-size:1.15rem}
.ad-form input[type="text"],.ad-form input[type="url"],.ad-form input[type="number"]{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:10px 12px;width:100%}
.ad-form input:focus{border-color:var(--gold);outline:none}
.ad-form .count{align-self:flex-end;font-size:.74rem;color:var(--muted);font-family:var(--mono)}
.ad-form .labelrow{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.ad-choice{display:flex;gap:8px;flex-wrap:wrap}
.ad-choice label,.ad-dur{position:relative;cursor:pointer}
.ad-choice input,.ad-dur input{position:absolute;opacity:0;pointer-events:none}
.ad-choice span,.ad-dur span{display:flex;flex-direction:column;align-items:center;gap:1px;padding:8px 14px;border:1px solid var(--line);border-radius:8px;background:var(--surface);
  transition:border-color .15s,background-color .15s;min-width:84px;text-align:center}
.ad-choice span b,.ad-dur span b{font-family:var(--display);font-weight:400;letter-spacing:.04em}
.ad-choice span small,.ad-dur span small{font-size:.74rem;color:var(--muted);font-family:var(--mono)}
.ad-choice input:checked+span,.ad-dur input:checked+span{border-color:var(--gold);background:var(--surface-2);box-shadow:0 0 0 1px var(--gold) inset}
.ad-choice input:focus-visible+span,.ad-dur input:focus-visible+span{outline:2px solid var(--gold-hi);outline-offset:2px}
.ad-durs{display:flex;gap:8px;flex-wrap:wrap}
.ad-redirect{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px dashed var(--line);border-radius:8px;font-size:.9rem;cursor:pointer}
.ad-redirect input{margin-top:3px;accent-color:var(--gold)}
.ad-redirect b{color:var(--gold)}
.ad-redirect small{display:block;color:var(--muted);font-size:.8rem}
.ad-redirect.off{opacity:.45;cursor:not-allowed}
.ad-sum{grid-column:1/-1;display:flex;align-items:center;gap:10px 22px;flex-wrap:wrap;padding:12px 14px;border-radius:8px;background:color-mix(in srgb,var(--gold) 8%,transparent);border:1px solid var(--line)}
.ad-sum span{display:flex;flex-direction:column;font-size:.74rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.ad-sum b{font-family:var(--mono);font-weight:500;font-size:1.2rem;letter-spacing:0;text-transform:none;color:var(--gold-hi)}
:root[data-theme="light"] .ad-sum b{color:var(--gold)}
.ad-after{font-size:.86rem;color:var(--muted);margin-left:auto}
.ad-after.short{color:var(--warn)}
.ad-go{grid-column:1/-1;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ad-go .msg{flex:1 1 200px}

/* the campaign table */
.ad-table td,.ad-table th{vertical-align:middle}
.ad-table .num{text-align:right}
.ad-table small{display:block;font-size:.72rem;color:var(--muted);font-family:var(--body)}
.ad-camp{min-width:160px;max-width:280px}
.ad-camp .ad-type{color:var(--muted);margin-top:1px}
.ad-table th{white-space:nowrap}
.ad-camp b{display:block;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ad-camp a{color:var(--gold);font-size:.82rem;overflow-wrap:anywhere}
.ad-camp .ad-note{color:var(--warn);white-space:normal}
.ad-table small.ad-when{margin-top:4px;white-space:nowrap}
.ad-gone td{opacity:.6}
.ad-none{color:var(--muted);text-align:center;padding:22px 10px!important;white-space:normal}
.ad-pill{display:inline-block;font-size:.72rem;letter-spacing:.04em;border-radius:999px;padding:2px 9px;border:1px solid var(--line);white-space:nowrap}
.ad-pill.ok{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 45%,transparent)}
.ad-pill.gold{color:var(--gold-hi);border-color:color-mix(in srgb,var(--gold) 55%,transparent)}
:root[data-theme="light"] .ad-pill.gold{color:var(--gold)}
.ad-pill.warn{color:var(--warn);border-color:color-mix(in srgb,var(--warn) 50%,transparent)}
.ad-pill.bad{color:var(--ad-red);border-color:color-mix(in srgb,var(--ad-red) 50%,transparent)}
.ad-pill.dim{color:var(--muted)}

/* the four glyph buttons under Actions */
/* 2 × 2 so the table fits beside the side tower: stats, add clicks / play-pause, delete */
.ad-acts{display:grid;grid-template-columns:repeat(2,32px);gap:5px;justify-content:end}
.ad-act{width:32px;height:32px;display:grid;place-items:center;padding:0;border-radius:8px;border:1px solid var(--line);background:var(--surface);cursor:pointer;color:var(--c);
  transition:background-color .15s,border-color .15s,transform .15s}
.ad-act svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ad-act svg .fill{fill:currentColor;stroke:none}
.ad-act.stats{--c:var(--ad-orange)} .ad-act.add{--c:var(--ad-blue)} .ad-act.play,.ad-act.pause{--c:var(--ad-green)} .ad-act.del{--c:var(--ad-red)}
.ad-act:hover:not(:disabled),.ad-act.on{border-color:var(--c);background:color-mix(in srgb,var(--c) 14%,var(--surface));transform:translateY(-1px)}
.ad-act.armed{border-color:var(--ad-red);background:var(--ad-red);color:#fff}
.ad-act:disabled{opacity:.3;cursor:not-allowed}

/* the row under a campaign: stats or add clicks */
.ad-extra td{background:color-mix(in srgb,var(--gold) 5%,transparent)}
.ad-extra-in{padding:6px 2px}
.ad-stats-top{display:flex;gap:8px 22px;flex-wrap:wrap;font-size:.86rem;color:var(--muted)}
.ad-stats-top b{color:var(--ink);font-weight:500}
.ad-chart{display:grid;grid-template-columns:repeat(14,minmax(0,1fr));gap:4px;align-items:end;height:110px;margin-top:12px}
.ad-bar{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:3px}
.ad-bar i{display:block;width:100%;max-width:28px;min-height:2px;border-radius:3px 3px 0 0;background:linear-gradient(180deg,var(--ad-orange),color-mix(in srgb,var(--ad-orange) 55%,transparent))}
.ad-bar small{font-size:.66rem!important;color:var(--muted)}
.ad-chart-note,.ad-loading{margin:8px 0 0;font-size:.78rem;color:var(--muted)}
.ad-addrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:6px}
.ad-addrow input{width:120px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:8px 10px}
.ad-addcost{font-family:var(--mono);font-size:.88rem;color:var(--muted)}
.ad-addcost.short{color:var(--warn)}

/* the rules */
.ad-rules{margin-top:22px;padding:12px 14px;border-left:3px solid var(--ad-red);background:color-mix(in srgb,var(--ad-red) 8%,transparent);border-radius:0 8px 8px 0;font-size:.88rem;color:var(--muted)}
.ad-rules b{color:var(--ink)}
.ad-rules .imp{display:block;margin-top:6px;color:var(--ink)}
.ad-rules .imp b{color:var(--ad-red)}

/* phones: the table becomes cards */
@media (max-width:700px){
  .ad-form{grid-template-columns:minmax(0,1fr)}
  .ad-table thead{display:none}
  .ad-table tr{display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px 0;border-bottom:1px solid var(--line)}
  .ad-table td{border:0;padding:2px 0}
  .ad-table td.ad-camp{grid-column:1/-1;max-width:none}
  .ad-table td.num{text-align:left}
  .ad-table tr.ad-extra{display:block}
  .ad-acts{grid-template-columns:repeat(4,32px);justify-content:start}
  .ad-table td.ad-actcell{grid-column:1/-1;padding-top:6px}
  .ad-table td[data-label]::before{content:attr(data-label);display:block;font-family:var(--body);font-size:.66rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
  .ad-balrow .ad-btns{margin-left:0}
}

/* ---------- the side tower's Advertise panel: balance, then three stacked buttons ---------- */
.ad-side{display:flex;flex-direction:column;gap:10px}
.ad-side .rowbetween{align-items:center}
.ad-side h3{display:flex;align-items:center;gap:8px}
.ad-glyph{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.ad-side-bal{font-family:var(--mono);color:var(--gold-hi);font-size:1.05rem}
:root[data-theme="light"] .ad-side-bal{color:var(--gold)}
.ad-side-note{margin:-6px 0 0;font-size:.76rem;color:var(--muted)}
.ad-stack{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--bg)}
.ad-stack button{display:flex;align-items:center;gap:12px;width:100%;padding:10px 14px;border:0;border-top:1px solid var(--line);background:none;cursor:pointer;text-align:left;
  transition:background-color .15s}
.ad-stack button:first-child{border-top:0;background:linear-gradient(180deg,color-mix(in srgb,var(--gold) 22%,transparent),color-mix(in srgb,var(--gold) 8%,transparent))}
.ad-stack button:hover{background:var(--surface-2)}
.ad-stack button svg{width:20px;height:20px;flex:none;fill:none;stroke:var(--gold);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ad-stack b{display:block;font-family:var(--display);font-weight:400;letter-spacing:.05em;color:var(--ink)}
.ad-stack small{display:block;font-size:.76rem;color:var(--muted)}
.ad-stack .arr{margin-left:auto;color:var(--muted)}

/* ---------- the Deposit and Transfer popups: the page blurs behind ---------- */
.adm-overlay{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:16px;background:rgba(4,7,24,.55);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
:root[data-theme="light"] .adm-overlay{background:rgba(58,17,8,.3)}
.adm-overlay[hidden]{display:none}
html.adm-open{overflow:hidden}
.adm-card{width:min(440px,100%);max-height:calc(100vh - 32px);overflow:auto;position:relative;animation:pvIn .2s ease-out}
.adm-card h2{color:var(--gold-hi);padding-right:30px}
:root[data-theme="light"] .adm-card h2{color:var(--gold)}
.adm-x{position:absolute;top:12px;right:12px;width:32px;height:32px;border-radius:50%;border:1px solid var(--line);background:none;cursor:pointer;font-size:1.3rem;line-height:1;color:var(--muted)}
.adm-x:hover{color:var(--ink);border-color:var(--gold)}
.adm-lede{margin:8px 0 0;color:var(--lede);font-size:.95rem}
.adm-facts{display:flex;gap:18px;flex-wrap:wrap;margin-top:12px;font-size:.86rem;color:var(--muted)}
.adm-facts b{color:var(--ink);font-weight:500}
.adm-form{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.adm-row{display:flex;gap:8px}
.adm-row input{flex:1;min-width:0;background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:10px 12px;font-family:var(--mono)}
.adm-row input:focus{border-color:var(--gold);outline:none}
.adm-sub{margin:0;font-size:.8rem;color:var(--muted)}
.adm-warn{margin:4px 0;padding:8px 10px;border-left:2px solid var(--warn);background:color-mix(in srgb,var(--warn) 8%,transparent);border-radius:0 6px 6px 0;font-size:.82rem;color:var(--muted)}
.adm-form .btn{align-self:flex-start}
.adm-recent{margin-top:16px;padding-top:12px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px;font-size:.84rem}
.adm-recent > div{display:flex;gap:10px;align-items:center}
.adm-recent > div b{margin-left:auto;font-weight:500}

/* v1.27.1: the view length is one compact box (a dropdown) with up/down arrows beside it, in the plain body font */
.ad-step{display:flex;align-items:stretch;border:1px solid var(--line);border-radius:6px;background:var(--surface);overflow:hidden;max-width:340px}
.ad-step:focus-within{border-color:var(--gold)}
.ad-step select{flex:1;min-width:0;appearance:none;-webkit-appearance:none;border:0;background:none;padding:10px 12px;font-family:var(--body);font-size:1rem;color:var(--ink);cursor:pointer}
.ad-step select:focus{outline:none}
.ad-step select option{background:var(--surface);color:var(--ink)}
.ad-arrows{display:flex;flex-direction:column;border-left:1px solid var(--line)}
.ad-arrows button{flex:1;width:34px;display:grid;place-items:center;padding:0;border:0;background:none;cursor:pointer;color:var(--gold)}
.ad-arrows button + button{border-top:1px solid var(--line)}
.ad-arrows button:hover:not(:disabled){background:var(--surface-2)}
.ad-arrows button:disabled{color:var(--muted);opacity:.35;cursor:default}
.ad-arrows svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* v1.27.2: Surf / Frame are just the word now; a little more room so they line up with the view-length box beside them */
.ad-choice span{padding:10px 20px;justify-content:center}
