/* Support card, ported from the reusable support-card.html. Colours follow the tree. */
#support-dialog, #tip-link {
  color-scheme: dark;
  --surface: #121316; --hover: #202227; --control: #6f747c; --action: #1d6aa8; --action-hover: #2379bd;
  --link: #9ed4ff; --accent-soft: #12293a; --soft-line: #2f5a7a;
}
* {box-sizing:border-box}
button,select,input {font:inherit}
.subtle {padding:5px 11px;min-height:34px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font-size:.86rem;font-weight:500;cursor:pointer;transition:background .12s,border-color .12s}
.subtle:hover:not(:disabled) {background:var(--hover);border-color:var(--control)}
.subtle[aria-pressed=true] {background:var(--accent-soft);border-color:var(--soft-line);color:var(--link)}
.subtle.quiet {border-color:transparent;background:transparent;color:var(--link)}
.subtle.quiet:hover:not(:disabled) {background:var(--accent-soft);border-color:transparent}
.download {min-height:44px;padding:8px 20px;border:1px solid var(--action);border-radius:12px;background:var(--action);color:white;font-weight:600;cursor:pointer;transition:background .12s}
.download:hover:not(:disabled) {background:var(--action-hover)}
.download.secondary {background:var(--surface);color:var(--link);border-color:var(--soft-line)}
.download.secondary:hover:not(:disabled) {background:var(--accent-soft)}
button:disabled {opacity:.5;cursor:default}
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
dialog {max-width:min(390px,calc(100% - 32px));width:100%;padding:22px;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--ink);box-shadow:0 20px 60px #171c2640}
dialog::backdrop {background:#171c2666}
dialog p {margin-top:10px;color:var(--muted)}
#support-dialog {max-width:min(460px,calc(100% - 28px))}
#support-dialog h2 {margin:0;padding-right:30px;font-size:1rem;font-weight:600;letter-spacing:-.01em;line-height:1.25}
#support-dialog > p {margin:10px 0 0}
#support-dialog {font:400 15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
a.download {display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none}
/* One payment method shows at a time; the switch at the top picks which. */
.pay-tabs {display:grid;grid-template-columns:1fr 1fr;gap:3px;margin-top:14px;padding:3px;border-radius:13px;background:var(--hover)}
.pay-tabs button {display:grid;justify-items:center;padding:7px 8px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-size:.95rem;font-weight:600;cursor:pointer}
.pay-tabs small {font-size:.74rem;font-weight:400}
.pay-tabs button[aria-pressed=true] {background:var(--surface);color:var(--ink);box-shadow:0 1px 3px #171c2626}
.pay {display:grid;gap:12px;margin-top:14px}
.pay p {margin:0}
.amounts {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.amounts .subtle {min-height:38px;font-size:.92rem}
.upi {display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px 18px}
/* A QR code must stay dark on white in both themes to scan reliably. */
.qr {width:172px;height:172px;padding:6px;border:1px solid var(--line);border-radius:14px;background:#fff}
.qr svg {display:block;width:100%;height:100%}
.upi-step {color:var(--ink);font-weight:500}
.upi-id {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;font-size:.85rem}
.more-link {justify-self:start;min-height:28px;padding:2px 0}
.more-link:hover:not(:disabled) {background:transparent;text-decoration:underline}
.pay-apps {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden}
/* App marks sit on white so their own colours read in both themes. */
.pay-app {display:grid;place-items:center;height:34px;padding:0 7px}
/* Only where a logo really opens its app (iPhone and iPad) does it get a button's dividers and press state. */
a.pay-app[href] + a.pay-app[href] {border-left:1px solid #e3e7ed}
a.pay-app[href]:active {background:#eef1f5}
.pay-app img {display:block;width:auto;height:14px;max-width:100%;object-fit:contain}
.card-row {display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.pay-apps.cards {flex:1 1 190px}
.pay-note {font-size:.8rem}
/* Phones and phone-width windows lead with a pay button; the QR code moves behind "Other ways". */
#upi-open {display:none;width:100%;min-height:50px;font-size:1rem}
.on-phone #upi-open {display:inline-flex}
.on-phone .upi {display:block}
.on-phone .qr,.on-phone #upi-how {display:none}
.on-phone .pay-app {height:40px}
@media (max-width:640px) {
  #upi-open {display:inline-flex}
  .upi {display:block}
  .qr,#upi-how {display:none}
}
#support-dialog.show-more .qr {display:block;margin:0 auto 12px}
/* Buy Me a Coffee's own button, stored in the page so nothing is fetched from their servers. */
.bmc {display:inline-block;border-radius:12px;line-height:0;transition:transform .15s,box-shadow .15s}
.bmc img {display:block;border-radius:12px}
.bmc:hover {transform:translateY(-2px);box-shadow:0 8px 20px #171c2633}
.upi-id code {padding:7px 10px;border-radius:8px;background:var(--hover);color:var(--ink);font:600 .88rem ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center;overflow:hidden;text-overflow:ellipsis}
.upi-id .subtle {min-height:34px;padding:3px 12px}
.support {display:inline-flex;align-items:center;gap:7px;text-decoration:none}
/* The tip button: a blue badge with a cup says "leave a tip", in the app's own colours. */
.tip-pill {display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:4px 15px 4px 5px;border:1px solid var(--line);border-radius:99px;background:var(--surface);color:var(--ink);font-size:.88rem;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s}
.tip-badge {flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--action);color:#fff;transition:transform .15s}
.tip-badge svg {width:15px;height:15px}
.tip-pill:hover {background:var(--accent-soft);border-color:var(--soft-line)}
.tip-pill:hover .tip-badge {transform:rotate(-10deg) scale(1.08)}
.support svg {flex:none;width:16px;height:16px}
.nudge-close {position:absolute;top:12px;right:12px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:var(--hover);color:var(--ink);cursor:pointer}
.nudge-close svg {width:11px;height:11px}
[hidden] {display:none!important}

/* Fit with this app: one typeface, centred dialog, calmer button motion. */
#support-dialog { margin: auto; font-family: var(--font); }
#support-dialog .upi-id code { font-family: var(--font); }
#support-dialog button:hover:not(:disabled) { transform: none; box-shadow: none; }
#support-dialog .pay-tabs button[aria-pressed=true] { background: #34373e; }
#support-dialog p { color: var(--muted); }
#support-dialog p.upi-step { color: var(--ink); }
#tip-link { position: fixed; top: 18px; right: 20px; animation: fade 1s .8s both; transition: background .12s, border-color .12s, opacity .3s, visibility 0s; }
body.has-panel #tip-link { opacity: 0; visibility: hidden; animation: none; }
body.growing #tip-link { pointer-events: none; }
@media (max-width: 760px) {
  #tip-link { top: 12px; right: 62px; width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  body.has-panel #tip-link { opacity: 1; visibility: visible; }
}
/* On phones the open search field needs the coffee button's space. */
@media (max-width: 760px) { body:has(.search.open) #tip-link { opacity: 0; visibility: hidden; animation: none; } }
