/* ForecastsPro — checkout and billing page (/billing).
 * Product on the left, the checkout card on the right; one column on phones with the
 * card right after the price. Return states (waiting, paid, …) use a centred focus layout. */

.billing {
  --bill-card-w: 460px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(88, 101, 242, 0.20), rgba(88, 101, 242, 0) 70%),
    radial-gradient(700px 480px at 100% 110%, rgba(56, 182, 255, 0.07), rgba(56, 182, 255, 0) 70%),
    var(--bg-deepest);
  background-attachment: fixed;
}

/* ---- Top bar ------------------------------------------------------------------ */
.bill-top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(26, 27, 30, 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bill-top-inner {
  max-width: 1160px; margin: 0 auto; height: 60px;
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-6);
}
.bill-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-primary); flex: none; }
.bill-brand:hover { text-decoration: none; }
.bill-brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 3px 10px var(--accent-glow); }
.bill-brand-name { font-size: var(--text-md); font-weight: 700; letter-spacing: -0.01em; }
.bill-top-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding-left: var(--space-4); border-left: 1px solid var(--line-strong);
  color: var(--text-subtle); font-size: var(--text-sm); font-weight: 550;
}
.bill-top-tag .icon { width: 14px; height: 14px; color: var(--success-text); }
.bill-top-user { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.bill-top-email { color: var(--text-subtle); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

/* ---- Layout ------------------------------------------------------------------- */
.bill-main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-8); }
.bill-main:focus { outline: none; }
/* In-page links (skip link, #bill-account, section anchors) land below the sticky header. */
.billing [id] { scroll-margin-top: calc(60px + var(--space-4)); }
.bill-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--bill-card-w);
  grid-template-areas: "intro panel" "details panel";
  grid-template-rows: auto 1fr;
  gap: var(--space-6) clamp(var(--space-6), 5vw, 72px);
  align-items: start;
}
.bill-intro { grid-area: intro; min-width: 0; }
.bill-panel { grid-area: panel; min-width: 0; }
.bill-details { grid-area: details; min-width: 0; }

/* Focus layout: the order status / plan card alone, centred. */
.bill-layout.is-focus { grid-template-columns: minmax(0, 600px); grid-template-areas: "panel"; grid-template-rows: auto; justify-content: center; }
.bill-layout.is-focus .bill-intro,
.bill-layout.is-focus .bill-details { display: none; }

/* ---- Product intro ---------------------------------------------------------------- */
.bill-product { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.bill-product-logo { width: 52px; height: 52px; border-radius: 14px; flex: none; box-shadow: 0 10px 30px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.bill-product-name { color: var(--text-primary); font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.bill-product-sub { color: var(--text-subtle); font-size: var(--text-sm); font-weight: 550; margin-top: 2px; }
.bill-title {
  font-size: clamp(26px, 3.1vw, 38px); line-height: 1.12; font-weight: 750; letter-spacing: -0.025em;
  max-width: 580px; text-wrap: balance;
}
.bill-lede { color: var(--text-muted); font-size: var(--text-md); line-height: 1.6; max-width: 560px; margin-top: var(--space-4); }
.bill-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); margin-top: var(--space-6); }
.bill-price-amount {
  color: var(--text-primary); font-size: 48px; font-weight: 750; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bill-price-per { color: var(--text-subtle); font-size: var(--text-lg); font-weight: 550; }
.bill-facts { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.bill-facts li {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-default); font-size: var(--text-sm); font-weight: 550;
}
.bill-facts .icon { width: 14px; height: 14px; color: var(--accent-text); }

/* ---- Details (what's included, trust) ---------------------------------------------- */
.bill-h2 {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-subtle); margin: var(--space-6) 0 var(--space-4);
}
.bill-details > .bill-h2:first-child { margin-top: var(--space-3); }
/* "What's included" and the trust list: media rows (base.css), a 36px tile each. */
.bill-included { list-style: none; display: grid; gap: var(--space-5); }
.bill-included .media-text a { font-weight: 550; overflow-wrap: anywhere; }
.bill-note {
  margin-top: var(--space-5); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-card); border: 1px dashed var(--border-soft);
  color: var(--text-muted); font-size: var(--text-sm); line-height: 1.5;
}
.bill-note + .bill-trust { margin-top: var(--space-4); }
.bill-trust {
  list-style: none; display: grid;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.bill-trust li { padding: var(--space-4); }
.bill-trust li + li { border-top: 1px solid var(--line); }
.bill-trust .media-text { font-size: var(--text-sm); }
.bill-disclaimer { margin-top: var(--space-5); color: var(--text-subtle); font-size: var(--text-sm); line-height: 1.5; max-width: 620px; }

/* ---- Cards ---------------------------------------------------------------------------- */
.bill-card {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}
.bill-panel > .bill-card {
  position: relative;
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.07), rgba(88, 101, 242, 0) 160px), var(--bg-card);
}
.bill-panel > .bill-card::before {
  /* A hairline of brand colour along the top edge. */
  content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 1px;
  background: linear-gradient(90deg, rgba(88, 101, 242, 0), rgba(174, 183, 255, 0.55), rgba(88, 101, 242, 0));
  pointer-events: none;
}
.bill-card-loading { padding: var(--space-6); display: grid; gap: var(--space-3); }
.bill-section { padding: var(--space-5) var(--space-6); }
.bill-section + .bill-section { border-top: 1px solid var(--line); }
.bill-section-title {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  font-size: var(--text-md); font-weight: 650; color: var(--text-primary); margin-bottom: var(--space-4);
}
.bill-step {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--text-xs); font-weight: 700;
}
.bill-section-title > span:first-child { display: inline-flex; align-items: center; gap: var(--space-2); }
.bill-notices { display: grid; gap: var(--space-3); padding: var(--space-5) var(--space-6) 0; }
.bill-notices:empty { display: none; }
.bill-notices .alert { font-size: var(--text-sm); }

/* Order summary */
.bill-line { display: flex; align-items: center; gap: var(--space-3); }
.bill-line img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.bill-line-main { flex: 1; min-width: 0; }
.bill-line-title { color: var(--text-primary); font-weight: 650; }
.bill-line-sub { color: var(--text-subtle); font-size: var(--text-sm); }
.bill-line-price { color: var(--text-primary); font-weight: 650; font-variant-numeric: tabular-nums; }
.bill-terms { list-style: none; display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.bill-terms li { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--text-muted); font-size: var(--text-sm); line-height: 1.45; }
.bill-terms .icon { width: 15px; height: 15px; margin-top: 1px; color: var(--text-subtle); }
.bill-terms strong { font-weight: 650; }
.bill-terms .is-key { color: var(--text-default); }
.bill-terms .is-key .icon { color: var(--warning-text); }
.bill-total {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px var(--space-3);
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line);
}
.bill-total-label { color: var(--text-primary); font-weight: 650; }
.bill-total-value { margin-left: auto; color: var(--text-primary); font-size: var(--text-xl); font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; }
.bill-total-value small { font-size: var(--text-sm); color: var(--text-default); font-weight: 600; margin-left: 6px; letter-spacing: 0; }
.bill-total-note { color: var(--text-default); font-size: var(--text-sm); line-height: 1.5; margin-top: var(--space-2); }

/* Coin picker */
.bill-coins { border: 0; margin: 0; padding: 0; min-width: 0; }
.bill-coins legend { padding: 0; }
.coin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.coin-opt {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  min-height: 60px; padding: var(--space-3);
  border-radius: 12px; border: 1px solid var(--border-soft);
  background: var(--bg-input);
  cursor: pointer; min-width: 0;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.coin-opt:hover { border-color: #50535b; background: #222327; }
.coin-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.coin-opt:has(input:checked) {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.16), rgba(88, 101, 242, 0.07));
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.coin-opt:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.coin-opt .coin-logo { flex: none; }
.coin-opt-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.coin-opt-code { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--text-primary); font-weight: 650; line-height: 1.2; }
.coin-opt-std {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
  border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted); font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.01em; white-space: nowrap;
}
.coin-opt:has(input:checked) .coin-opt-std { background: rgba(88, 101, 242, 0.28); color: var(--accent-text); }
.coin-opt-net { color: var(--text-subtle); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-opt-hint { color: var(--text-muted); font-size: var(--text-xs); font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Two columns: the check sits in the corner, so the coin and its network pill get the
   width (a one-column list on phones puts it back at the end of the row). */
.coin-grid .coin-opt { padding-right: 34px; }
.coin-grid .coin-opt-check { position: absolute; top: 10px; right: 10px; }
.coin-opt-check {
  margin-left: auto; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%;
  border: 1.5px solid #5b5f69; display: grid; place-items: center; color: #fff;
}
.coin-opt-check .icon { width: 12px; height: 12px; stroke-width: 3; opacity: 0; transform: scale(0.6); transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.coin-opt:has(input:checked) .coin-opt-check { background: var(--accent); border-color: var(--accent); }
.coin-opt:has(input:checked) .coin-opt-check .icon { opacity: 1; transform: none; }
.coin-logo {
  display: inline-grid; place-items: center; border-radius: 50%;
  font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* "Before you pay" */
.bill-warn {
  margin-top: var(--space-4); padding: var(--space-4);
  border-radius: 12px; border: 1px solid rgba(240, 177, 50, 0.32);
  background: linear-gradient(180deg, rgba(240, 177, 50, 0.12), rgba(240, 177, 50, 0.06));
}
.bill-warn-title { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--text-primary); font-weight: 650; line-height: 20px; margin-bottom: var(--space-2); }
.bill-warn-title .icon { color: var(--warning-text); margin-top: 1px; }
.bill-warn ul { list-style: none; display: grid; gap: var(--space-2); }
.bill-warn li { position: relative; padding-left: 16px; color: var(--text-default); font-size: var(--text-sm); line-height: 1.5; }
.bill-warn li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--warning-text); }
.bill-warn b { color: var(--text-primary); }

/* Consents */
.bill-consents { display: grid; gap: var(--space-2); }
.consent {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3); border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
  color: var(--text-default); font-size: var(--text-sm); line-height: 1.5; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.consent:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.035); }
.consent:has(input:checked) { border-color: rgba(88, 101, 242, 0.45); background: rgba(88, 101, 242, 0.07); }
.consent input { margin-top: 1px; }
.consent a { font-weight: 600; }
/* A consent box's statements, one per line. */
.consent-lines { display: grid; gap: var(--space-2); }
.consent-line { display: block; }

/* Pay */
.bill-pay { padding-top: var(--space-2); }
.btn-pay {
  width: 100%; height: 54px; border-radius: 12px;
  font-size: var(--text-md); font-weight: 700; letter-spacing: -0.005em;
  box-shadow: 0 10px 28px rgba(88, 101, 242, 0.35);
}
.btn-pay:disabled { box-shadow: none; }
.btn-pay .icon { width: 18px; height: 18px; }
.bill-pay-hint { margin-top: var(--space-3); color: var(--text-subtle); font-size: var(--text-sm); text-align: center; line-height: 1.5; }
.bill-pay-hint strong { color: var(--text-default); font-weight: 600; overflow-wrap: anywhere; }
.bill-pay .alert { margin-bottom: var(--space-3); }
.bill-secure {
  display: block; padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.14);
  color: var(--text-subtle); font-size: var(--text-sm); line-height: 1.5; text-align: center; text-wrap: balance;
}
.bill-secure .icon { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; color: var(--success-text); }

/* ---- Status / plan card (focus layout) ------------------------------------------------ */
.bill-status { padding: var(--space-7) var(--space-7) var(--space-6); text-align: center; }
.bill-status:focus { outline: none; }
.status-ring {
  position: relative; width: 72px; height: 72px; margin: 0 auto var(--space-5);
  border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.status-ring .icon { width: 30px; height: 30px; }
.status-ring.success { background: var(--success-soft); color: var(--success-text); }
.status-ring.warning { background: var(--warning-soft); color: var(--warning-text); }
.status-ring.danger { background: var(--danger-soft); color: var(--danger-text); }
.status-ring.neutral { background: var(--neutral-soft); color: var(--text-muted); }
.status-ring.is-waiting::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent); border-right-color: rgba(88, 101, 242, 0.35);
  animation: fp-spin 1.6s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .status-ring.is-waiting::after { animation: none; border-color: rgba(88, 101, 242, 0.45); } }
.bill-status h1, .bill-status h2 { font-size: var(--text-2xl); font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
.bill-status .lead { color: var(--text-muted); font-size: var(--text-md); line-height: 1.6; margin: var(--space-3) auto 0; max-width: 460px; }
.bill-status .lead strong { color: var(--text-primary); }
.status-big { margin-top: var(--space-5); }
.status-big-value { color: var(--text-primary); font-size: 44px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.status-big-label { color: var(--text-subtle); font-size: var(--text-sm); margin-top: var(--space-2); }
.status-meter { height: 8px; border-radius: 4px; background: var(--bg-active); overflow: hidden; margin: var(--space-4) auto 0; max-width: 360px; }
.status-meter > span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #7984ff); }
.status-meter.warn > span { background: var(--warning); }

.status-callout {
  display: grid; gap: 2px; margin-top: var(--space-6); padding: var(--space-4);
  border-radius: 12px; border: 1px solid rgba(88, 101, 242, 0.4); background: var(--accent-soft);
  text-align: left; font-size: var(--text-base); line-height: 1.5;
}
.status-callout strong { color: var(--text-primary); }
.status-callout span { color: var(--text-default); }
.status-points { list-style: none; display: grid; gap: var(--space-3); margin: var(--space-6) 0 0; text-align: left; }
.status-points li { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--text-default); font-size: var(--text-base); line-height: 1.55; }
.status-points .icon { width: 17px; height: 17px; margin-top: 3px; color: var(--text-subtle); }

.status-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-6); }
/* Full-width, and a long label (an email address) wraps instead of running out of the card. */
.status-actions .btn {
  width: 100%; height: auto; min-height: 46px; padding-top: 10px; padding-bottom: 10px;
  font-size: var(--text-md); line-height: 1.25; white-space: normal; text-align: center; overflow-wrap: anywhere;
}
.status-meta {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px var(--space-3);
  margin-top: var(--space-4); color: var(--text-subtle); font-size: var(--text-sm); font-variant-numeric: tabular-nums;
}
.status-meta .link-button { font-size: var(--text-sm); font-weight: 600; }

/* Timeline (waiting / paid) */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-6); }
.timeline li { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); color: var(--text-subtle); font-size: var(--text-sm); font-weight: 550; text-align: center; }
.timeline li::before {
  content: ""; position: absolute; top: 11px; left: calc(-50% + 16px); right: calc(50% + 16px);
  height: 2px; border-radius: 1px; background: var(--bg-active);
}
.timeline li:first-child::before { display: none; }
.timeline .tl-dot {
  position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid #5b5f69; background: var(--bg-card);
}
.timeline .tl-dot .icon { width: 13px; height: 13px; stroke-width: 3; }
.timeline li.done { color: var(--text-default); }
.timeline li.done .tl-dot { background: var(--success); border-color: var(--success); color: var(--on-semantic); }
.timeline li.done::before, .timeline li.current::before { background: var(--success); }
.timeline li.current { color: var(--text-primary); }
.timeline li.current .tl-dot { border-color: var(--accent); }
.timeline li.current .tl-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: fp-breathe 1.8s var(--ease) infinite; }
@keyframes fp-breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .timeline li.current .tl-dot::after { animation: none; } }

/* Order facts (dl) */
.order-facts {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2) var(--space-5);
  margin: var(--space-6) 0 0; padding: var(--space-4) var(--space-5);
  border-radius: 12px; background: var(--bg-input); border: 1px solid var(--line);
  text-align: left; font-size: var(--text-sm);
}
.order-facts dt { color: var(--text-subtle); }
.order-facts dd { margin: 0; color: var(--text-default); text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.order-facts .mono { color: var(--text-primary); }

/* ---- Receipts -------------------------------------------------------------------------- */
.bill-receipts { margin-top: var(--space-8); }
.bill-receipts:focus { outline: none; }
.bill-layout.is-focus ~ .bill-receipts { max-width: 600px; margin-left: auto; margin-right: auto; }
.bill-receipts .bill-card { box-shadow: var(--shadow-card); border-color: var(--line); }
.receipts-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.receipts-head h2 { font-size: var(--text-md); display: flex; align-items: center; gap: var(--space-2); }
.receipts-head h2 .icon { color: var(--text-subtle); }
.receipts-head p { color: var(--text-subtle); font-size: var(--text-sm); }
.receipt-list { list-style: none; }
.receipt {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px var(--space-4);
  padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line);
}
.receipt:last-child { border-bottom: 0; }
.receipt .coin-logo { grid-row: span 2; }
.receipt-title { color: var(--text-primary); font-weight: 600; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.receipt-sub { color: var(--text-subtle); font-size: var(--text-sm); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.receipt-end { grid-row: span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.receipt-amount { color: var(--text-primary); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); }
.receipt-actions a, .receipt-actions .link-button { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.receipt-actions .receipt-withdraw { color: var(--danger-text, var(--text-default)); }
.receipts-head strong { color: var(--text-default); font-weight: 600; overflow-wrap: anywhere; }
.bill-pay-hint .link-button { font-size: inherit; font-weight: 600; }

/* "Your receipt goes to …" on the order status card: big enough to spot a typo while it can
   still be corrected (the email address is confirmed after paying). */
.status-email {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin-top: var(--space-6); padding: var(--space-4);
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg-input);
  text-align: left;
}
.status-email > .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--accent-text); }
.status-email-label { display: block; color: var(--text-subtle); font-size: var(--text-sm); }
.status-email strong { display: block; color: var(--text-primary); font-size: var(--text-md); overflow-wrap: anywhere; }
.status-email-note { display: block; margin-top: var(--space-1); color: var(--text-muted); font-size: var(--text-sm); line-height: 1.5; }
.status-email-note .link-button { font-weight: 600; }

/* ---- Account (accounts without access can't open the app's Account page) ---------------- */
.bill-account { margin-top: var(--space-6); scroll-margin-top: 76px; }
.account-rows { list-style: none; }
/* Tile | title and text | action. The title's first line is centred on the tile, the action
   on the row. */
.account-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--space-3) var(--space-4);
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line);
}
.account-row:last-child { border-bottom: 0; }
.account-row-main { padding-top: calc((var(--tile-md) - 20px) / 2); min-width: 0; }
.account-row-main strong { display: block; color: var(--text-primary); font-weight: 600; line-height: 20px; }
.account-row-main span { display: block; color: var(--text-subtle); font-size: var(--text-sm); line-height: 1.45; margin-top: 2px; }
.account-row .btn { white-space: nowrap; align-self: center; }
/* The password / delete dialogs (app.css, which has this rule, isn't loaded here). */
.form-stack { display: flex; flex-direction: column; gap: var(--space-4); max-width: 440px; }
.form-stack .field + .field { margin-top: 0; }

/* ---- Footer --------------------------------------------------------------------------- */
.bill-footer {
  width: 100%; max-width: 1160px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5);
  padding: var(--space-5) var(--space-6) var(--space-7);
  border-top: 1px solid var(--line);
  color: var(--text-subtle); font-size: var(--text-sm);
}
.bill-footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.bill-footer-links a { color: var(--text-subtle); }
.bill-footer-links a:hover { color: var(--text-primary); }

/* ---- Responsive ----------------------------------------------------------------------- */
@media (max-width: 900px) {
  .billing { --bill-card-w: 100%; background-attachment: scroll; }
  .bill-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "panel" "details";
    grid-template-rows: auto;
    gap: var(--space-6);
  }
  .bill-panel { width: 100%; max-width: 560px; margin: 0 auto; }
  .bill-intro, .bill-details { max-width: 560px; margin: 0 auto; width: 100%; }
  .bill-main { padding: var(--space-6) var(--gutter) var(--space-7); }
  .bill-top-inner { padding: 0 var(--gutter); }
  .bill-footer { padding-left: var(--gutter); padding-right: var(--gutter); }
  .bill-product { margin-bottom: var(--space-4); }
  .bill-price { margin-top: var(--space-5); }
  .bill-price-amount { font-size: 40px; }
}
@media (max-width: 600px) {
  .bill-top-tag { display: none; }
  .bill-top-email { display: none; }
  .bill-title { font-size: 22px; }
  /* Phones: the order summary right below repeats the lede's point and the three plan
     chips (365 days, no auto-renew, no refunds), so the pay button comes sooner. */
  .bill-lede, .bill-facts { display: none; }
  .bill-product { margin-bottom: var(--space-3); }
  .bill-price { margin-top: var(--space-4); }
  .bill-price-per { font-size: var(--text-md); white-space: nowrap; }
  .bill-layout { gap: var(--space-5); }
  .bill-section { padding: var(--space-5) var(--space-4); }
  .bill-notices { padding: var(--space-4) var(--space-4) 0; }
  .bill-secure { padding: var(--space-3) var(--space-4); }
  .bill-status { padding: var(--space-6) var(--space-4) var(--space-5); }
  .bill-status h1, .bill-status h2 { font-size: var(--text-xl); text-wrap: balance; }
  .status-big-value { font-size: 38px; }
  .order-facts { padding: var(--space-3) var(--space-4); gap: var(--space-2) var(--space-3); }
  /* Receipts: logo | title, text, then the amount with the copy button on its right and any
     text action (view status, withdraw, contact support) on its own line below. */
  .receipt { grid-template-columns: auto minmax(0, 1fr); padding: var(--space-3) var(--space-4); gap: 4px var(--space-3); align-items: start; }
  .receipt .coin-logo { grid-row: span 3; }
  .receipt-end {
    grid-row: auto; grid-column: 2; order: 3;
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2px var(--space-3);
    min-width: 0;
  }
  .receipt-actions { display: contents; }
  .receipt-amount { order: 1; }
  .receipt-actions > .btn { order: 2; margin-left: auto; }
  .receipt-actions > a, .receipt-actions > .link-button { order: 3; flex: 1 1 100%; text-align: left; white-space: normal; padding: 2px 0; }
  .receipts-head { padding: var(--space-4); }
  .bill-footer {
    padding-top: var(--space-5); padding-bottom: max(var(--space-7), calc(env(safe-area-inset-bottom) + var(--space-5)));
    flex-direction: column; align-items: flex-start;
  }
  .timeline li { font-size: var(--text-xs); }
  .account-row { grid-template-columns: auto minmax(0, 1fr); padding: var(--space-4); }
  .account-row .btn { grid-column: 2; justify-self: start; align-self: start; }
  /* The coin picker becomes a one-column list: logo | coin and pill, then network · note. */
  .coin-grid { grid-template-columns: minmax(0, 1fr); }
  .coin-opt, .coin-grid .coin-opt { min-height: 56px; padding: 10px var(--space-3); }
  .coin-grid .coin-opt-check { position: static; }
  .coin-opt-text { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .coin-opt-code { flex: 1 1 100%; margin-bottom: 2px; }
  .coin-opt-net { flex: 0 1 auto; }
  .coin-opt-hint { flex: 0 1 auto; font-size: var(--text-sm); }
  .coin-opt-hint::before { content: "·"; margin-right: 6px; color: var(--text-dim); font-weight: 400; }
}
@media (max-width: 420px) {
  /* Icon-only header buttons (their accessible names stay), square. */
  .bill-btn-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .bill-top-user .btn-sm:has(.bill-btn-text) { width: 36px; padding: 0; }
}
@media (max-width: 420px) and (pointer: coarse) {
  .bill-top-user .btn-sm:has(.bill-btn-text) { width: 40px; }
}
