/* ============================================================
   Astrowani web client — sign-in, wallet, ringing, chat, call.

   Uses the site's own three brand tokens (--maroon / --cream / --gold) and
   nothing else, so the "revert colors" theme toggle inverts these overlays
   along with the rest of the page for free.

   CACHE-BUSTING: like style.css, every <link> to this file carries "?v=N".
   Bump it in every HTML page whenever this file changes — Cloudflare caches
   it for hours independently of the HTML.
   ============================================================ */

/* ---------- overlay shell ---------- */
.aw-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity .2s ease;
}
.aw-overlay.is-open { opacity: 1; }
.aw-overlay-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--maroon) 72%, transparent);
  backdrop-filter: blur(3px);
}
.aw-overlay-body {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  transform: translateY(12px) scale(.98);
  transition: transform .26s cubic-bezier(.16,.84,.44,1);
}
.aw-overlay.is-open .aw-overlay-body { transform: translateY(0) scale(1); }

.aw-card {
  position: relative; background: var(--paper); color: var(--ink);
  border-radius: 22px; padding: 28px 24px;
  box-shadow: 0 30px 70px -24px color-mix(in srgb, var(--maroon) 60%, transparent);
  border: 1px solid var(--border-soft);
}
.aw-card-sm { padding: 24px 22px; }
.aw-card-title { margin: 0 0 8px; font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 23px; font-weight: 400; color: var(--maroon); }
.aw-card-text { margin: 0 0 18px; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.aw-fineprint { margin: 14px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-faint); text-align: center; }
.aw-fineprint a { color: var(--gold-deep); text-decoration: underline; }

.aw-close {
  position: absolute; top: 12px; right: 14px; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--ink-soft);
}
.aw-close:hover { background: color-mix(in srgb, var(--maroon) 8%, transparent); }

/* ---------- forms ---------- */
/* The UA's [hidden] rule is display:none at the LOWEST specificity, so any
   `display:` declaration on the same element silently defeats it. This bit
   twice — the new-account name field rendered visible, and the chat room
   showed through the connecting screen — so it is enforced once, globally,
   for everything this stylesheet owns. */
.aw-overlay [hidden],
.aw-screen [hidden],
[hidden].aw-screen-main,
[hidden].aw-call-live,
[hidden].aw-stage { display: none !important; }
.aw-form { display: block; }
.aw-field { display: block; margin-bottom: 14px; }
.aw-field-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.aw-field input {
  width: 100%; box-sizing: border-box; padding: 13px 14px; font: inherit; font-size: 16px;
  color: var(--ink); background: color-mix(in srgb, var(--cream) 60%, #fff 40%);
  border: 1.5px solid var(--border-soft); border-radius: 12px; outline: none;
}
.aw-field input:focus { border-color: var(--gold-deep); }
.aw-phone-input { display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--border-soft); border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--cream) 60%, #fff 40%); }
.aw-phone-input:focus-within { border-color: var(--gold-deep); }
.aw-phone-input .aw-phone-cc { padding-left: 14px; font-weight: 800; color: var(--ink-soft); }
.aw-phone-input input { border: 0; background: transparent; border-radius: 0; }
.aw-otp-input { letter-spacing: .5em; text-align: center; font-weight: 800; font-size: 20px; }
.aw-error { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #B3261E; }
:root[data-theme="inverted"] .aw-error { color: #FFB4AB; }

.aw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 15px; font-weight: 700;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.aw-btn:disabled { opacity: .6; cursor: default; }
.aw-btn-block { width: 100%; }
.aw-btn-gold { background: var(--gold); color: var(--maroon); }
.aw-btn-gold:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.05); }
.aw-btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border-soft); }
.aw-btn-ghost:not(:disabled):hover { background: color-mix(in srgb, var(--maroon) 7%, transparent); }
.aw-btn-end { background: #B3261E; color: #fff; padding: 10px 18px; font-size: 14px; }
.aw-linkbtn { background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--gold-deep); text-decoration: underline; }
.aw-linkbtn:disabled { color: var(--ink-faint); text-decoration: none; cursor: default; }
.aw-resend { display: block; margin: 12px auto 0; }
.aw-card-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.aw-card-actions.aw-stack { flex-direction: column; }

/* ---------- recharge ---------- */
.aw-amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.aw-amount {
  padding: 12px 4px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border-soft); background: transparent;
  font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 15px; font-weight: 700; color: var(--ink);
}
.aw-amount:hover { border-color: var(--gold-deep); }
.aw-amount.is-active { background: var(--gold); border-color: var(--gold); color: var(--maroon); }

.aw-balance-box {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-radius: 16px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--gold) 16%, var(--cream) 84%);
  border: 1px solid color-mix(in srgb, var(--gold-deep) 35%, transparent);
}
.aw-balance-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.aw-balance-value { font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 26px; color: var(--maroon); }
.aw-nav-balance { font-weight: 800; }

/* ---------- ringing ---------- */
.aw-ring-card { text-align: center; }
.aw-ring-avatar { position: relative; width: 104px; height: 104px; margin: 4px auto 18px; }
.aw-ring-avatar img { position: relative; z-index: 1; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.aw-ring-pulse {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--gold); animation: awPulse 1.8s ease-out infinite;
}
.aw-ring-pulse.is-connected { animation: none; border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
@keyframes awPulse {
  0% { transform: scale(.86); opacity: .9; }
  100% { transform: scale(1.25); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .aw-ring-pulse { animation: none; } }
.aw-ring-rate { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-faint); }

/* ============================================================
   FULL SCREENS (chat.html / call.html)

   These are pages, not overlays. Only signing in is a popup — everything a
   visitor would expect a URL and a back button for is a real screen.
   ============================================================ */
.aw-screen-body {
  margin: 0; background: var(--page-bg);
  /* A fixed full-height screen on iOS still rubber-bands, showing white behind
     it and letting a swipe scroll the page under a live consultation. */
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
.aw-screen {
  display: flex; flex-direction: column; overflow: hidden;
  /* 100vh is WRONG on mobile: it is the height WITHOUT the address bar, so the
     bottom of the screen (the compose box, the End button) sits under it. dvh
     tracks the visible viewport and shrinks when the keyboard opens. vh stays
     only as the fallback for browsers that predate dvh.
     --aw-vh is set by the keyboard handler in chat-page.js for iOS Safari,
     which does not resize dvh when the keyboard appears. */
  height: 100vh;
  height: 100dvh;
  height: var(--aw-vh, 100dvh);
}
.aw-screen-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--maroon); color: var(--cream); flex: 0 0 auto;
  /* Clears the notch / status bar when the page is in a standalone-ish view. */
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}
.aw-back {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream); font-size: 20px; text-decoration: none;
}
.aw-back:hover { background: color-mix(in srgb, var(--cream) 14%, transparent); }
.aw-peer-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold); flex: 0 0 auto; }
.aw-peer-who { flex: 1 1 auto; min-width: 0; }
.aw-peer-name { font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 17px; }
.aw-peer-meta { font-size: 12px; color: var(--cream-muted); }
.aw-screen-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }

/* connecting / error state shared by both screens */
.aw-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 24px; }
.aw-stage-card { text-align: center; max-width: 420px; }
.aw-stage-title { font-family: 'Marcellus', 'Marcellus Fallback', serif; font-weight: 400; font-size: 26px;
  color: var(--ink); margin: 0 0 8px; }
.aw-call-screen .aw-stage-title { color: var(--cream); }
.aw-stage-text { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 22px; }
.aw-call-screen .aw-stage-text { color: var(--cream-muted); }
.aw-stage-spinner {
  width: 46px; height: 46px; margin: 0 auto 20px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-top-color: var(--gold); animation: awSpin 1s linear infinite;
}
@keyframes awSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .aw-stage-spinner { animation: none; } }

/* The whole chat screen is the app's maroon room, not this site's cream page —
   otherwise the connecting/error state is cream, the conversation below it is
   maroon, and a refresh flashes between the two. Same treatment the call screen
   already gets further down. */
.aw-chat-body { background: #592a19; }
.aw-chat-screen { background: #592a19; color: var(--cream); }
.aw-chat-screen .aw-stage-title { color: var(--cream); }
.aw-chat-screen .aw-stage-text { color: var(--cream-muted); }

/* ---------- chat screen ----------
   Colours are taken from the CUSTOMER APP's ChatSessionScreen (styles block at
   the foot of src/screens/ChatSessionScreen.js) rather than from this site's
   cream palette. The site colours washed the conversation out: gold bubbles
   with maroon text, and a near-cream "theirs" bubble, both on a cream page, so
   the messages were barely readable. The app's scheme is a dark maroon room
   with white cards, which is high-contrast and is also what a customer who uses
   both already recognises.

   App → web mapping (app hex values are literal, from COLORS in
   src/Theme/Colors.js, so they stay put even if this site's tokens change):
     container / my bubble  AstroMaroon #592a19
     their bubble           #fff, text #2c3e50
     my bubble text         #fff
     their timestamp        #888        my timestamp rgba(255,255,255,.7)
     input row              #fff, field #f9f9f9, border #e0e0e0, text #333  */
.aw-chat-log {
  flex: 1 1 auto; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: #592a19;
  /* Keep a scroll gesture inside the log instead of chaining to the page. */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.aw-chat-sys { align-self: center; max-width: 85%; text-align: center;
  font-size: 12px; line-height: 1.5; color: rgba(247,239,233,.72); padding: 6px 10px; }
.aw-msg {
  max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45;
  /* The app gives every bubble elevation: 2. Without it "my" maroon bubble has
     no edge against the maroon room behind it. */
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  /* An auto-sent birth-details message is multi-line and must keep its lines. */
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.aw-msg.is-mine {
  align-self: flex-end; background: #592a19; color: #fff; border-bottom-right-radius: 5px;
  /* Not in the app (Android elevation does this job there); on the web a maroon
     card on a maroon wall needs a real edge. */
  border: 1px solid rgba(255,215,0,.38);
}
.aw-msg.is-theirs { align-self: flex-start; background: #fff; color: #2c3e50; border-bottom-left-radius: 5px; }
.aw-msg.is-pending { opacity: .6; }
.aw-msg-time { margin-top: 4px; font-size: 11px; text-align: right; }
.aw-msg.is-theirs .aw-msg-time { color: #888; }
.aw-msg.is-mine .aw-msg-time { color: rgba(255,255,255,.7); }

/* The session intro banner, same as the app's SessionIntroBanner component. */
.aw-chat-banner {
  display: flex; align-items: flex-start; gap: 8px; flex: 0 0 auto;
  margin: 8px 10px 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(89,42,25,.94); border: 1px solid rgba(255,215,0,.35);
  color: #F7EFE9; font-size: 12.5px; line-height: 1.5;
}
.aw-chat-banner-icon { flex: 0 0 auto; color: #FFD700; line-height: 1; }
.aw-chat-banner-text { flex: 1 1 auto; min-width: 0; }
.aw-chat-banner-close {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer; padding: 0 2px;
  color: rgba(255,255,255,.7); font-size: 15px; line-height: 1;
}

.aw-chat-compose {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid #f0f0f0; flex: 0 0 auto;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: #fff;
}
.aw-chat-compose input {
  /* 16px IS LOAD-BEARING: iOS Safari zooms the whole page in when a focused
     input is smaller than 16px, and never zooms back out — which leaves the
     chat half off-screen for the rest of the consultation. */
  flex: 1 1 auto; min-width: 0; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1.5px solid #e0e0e0; border-radius: 999px; outline: none;
  background: #f9f9f9; color: #333;
}
.aw-chat-compose input::placeholder { color: #808080; }
.aw-chat-compose input:focus { border-color: var(--gold-deep); }

/* ---------- call screen ---------- */
.aw-call-body { background: var(--maroon); }
.aw-call-screen { background: var(--maroon); color: var(--cream); }
.aw-call-live { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.aw-call-stage-area { position: relative; flex: 1 1 auto; display: flex;
  align-items: center; justify-content: center; overflow: hidden; }
/* The remote video only earns its space on a video call. */
.aw-remote-video { display: none; }
body.is-video-call .aw-remote-video { display: block; }
.aw-local-video { display: none; }
body.is-video-call .aw-local-video { display: block; }
body.is-video-call .aw-call-peer {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 16px; z-index: 3;
  background: color-mix(in srgb, var(--maroon) 70%, transparent);
}
body.is-video-call .aw-call-peer .aw-ring-avatar { width: 54px; height: 54px; margin-bottom: 8px; }
.aw-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.aw-local-video {
  position: absolute; right: 14px; bottom: 14px; width: 104px; height: 150px;
  object-fit: cover; border-radius: 14px; border: 2px solid var(--gold);
  background: #000; z-index: 2;
}
.aw-call-peer { position: relative; z-index: 1; text-align: center; padding: 20px; }
.aw-call-name { font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 21px; margin-top: 4px; }
.aw-call-status { font-size: 13.5px; color: var(--cream-muted); margin-top: 4px; }
.aw-call-controls {
  display: flex; gap: 12px; justify-content: center; padding: 14px; flex: 0 0 auto;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.aw-ctl {
  /* 48px minimum: these are thumb targets on a phone, during a paid call, and
     a mis-tap on "End" is expensive. */
  min-height: 48px; min-width: 48px;
  padding: 12px 18px; border-radius: 999px; cursor: pointer; font: inherit;
  font-size: 14px; font-weight: 700;
  border: 1.5px solid color-mix(in srgb, var(--cream) 35%, transparent);
  background: transparent; color: var(--cream);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.aw-ctl:hover { background: color-mix(in srgb, var(--cream) 12%, transparent); }
.aw-ctl.is-on { background: var(--gold); color: var(--maroon); border-color: var(--gold); }
.aw-ctl-end { background: #B3261E; border-color: #B3261E; color: #fff; }
.aw-call-rate { text-align: center; font-size: 11.5px; color: var(--cream-muted); padding: 0 0 14px; }

/* ---------- wallet history ---------- */
.aw-history-list { max-height: 50vh; overflow-y: auto; margin-top: 6px; }
.aw-history-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px;
  border-bottom: 1px solid var(--border-softer); }
.aw-history-main { flex: 1 1 auto; min-width: 0; }
.aw-history-desc { font-size: 14px; font-weight: 700; color: var(--ink); }
.aw-history-date { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.aw-history-amt { font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 16px; flex: 0 0 auto; }
.aw-history-amt.is-credit { color: #1B7F3B; }
.aw-history-amt.is-debit { color: var(--ink-soft); }
:root[data-theme="inverted"] .aw-history-amt.is-credit { color: #7BD79B; }

/* ---------- live status pill on astrologer cards ---------- */
.astro-status {
  display: none; align-items: center; gap: 5px;
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
}
.astro-status.is-online, .astro-status.is-busy, .astro-status.is-offline, .astro-status.is-live { display: inline-flex; }
.astro-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.astro-status.is-online { background: color-mix(in srgb, #1B7F3B 16%, var(--cream)); color: #1B7F3B; }
.astro-status.is-busy { background: color-mix(in srgb, var(--gold) 30%, var(--cream)); color: var(--gold-deep); }
.astro-status.is-live { background: #B3261E; color: #fff; }
.astro-status.is-offline { background: color-mix(in srgb, var(--maroon) 12%, var(--cream)); color: var(--ink-faint); }
.astro-card { position: relative; }
[data-aw-action] { cursor: pointer; font: inherit; }
[data-aw-action].is-unavailable { opacity: .55; }

/* ---------- wallet page ---------- */
.aw-wallet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 860px) { .aw-wallet-grid { grid-template-columns: 1fr; } }

/* ---------- "you have a consultation running" bar ---------- */
.aw-resume-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 120%);
  z-index: 8000; display: flex; align-items: center; gap: 12px;
  width: min(94vw, 680px); padding: 12px 16px; border-radius: 999px;
  background: var(--maroon); color: var(--cream);
  box-shadow: 0 22px 44px -18px color-mix(in srgb, var(--maroon) 75%, transparent);
  transition: transform .3s cubic-bezier(.16,.84,.44,1);
}
.aw-resume-bar.is-open { transform: translate(-50%, 0); }
.aw-resume-dot { width: 9px; height: 9px; border-radius: 50%; background: #7BD79B; flex: 0 0 auto;
  animation: awPulseDot 1.6s ease-out infinite; }
@keyframes awPulseDot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .aw-resume-dot { animation: none; } }
.aw-resume-text { flex: 1 1 auto; font-size: 13.5px; font-weight: 700; }
.aw-resume-bar .aw-btn { padding: 9px 16px; font-size: 13.5px; flex: 0 0 auto; }
.aw-resume-bar .aw-btn-ghost { color: var(--cream); border-color: color-mix(in srgb, var(--cream) 35%, transparent); }

/* ---------- toasts ---------- */
.aw-toast-host {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 9500; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 420px);
}
.aw-toast {
  padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--maroon); color: var(--cream);
  box-shadow: 0 18px 36px -16px color-mix(in srgb, var(--maroon) 70%, transparent);
  opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease;
  text-align: center;
}
.aw-toast.is-open { opacity: 1; transform: translateY(0); }
.aw-toast-error { background: #B3261E; color: #fff; }
.aw-toast-success { background: #1B7F3B; color: #fff; }

/* ---------- phones ---------- */
@media (max-width: 560px) {
  /* The sign-in popup becomes a bottom sheet — thumb-reachable, and it does not
     cover the field being typed into when the keyboard opens. */
  .aw-overlay { padding: 0; align-items: flex-end; }
  .aw-overlay-body { max-width: none; }
  .aw-card {
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    max-height: 92dvh; overflow-y: auto;
  }
  /* Same iOS zoom-on-focus rule as the chat composer. */
  .aw-field input, .aw-phone-input input { font-size: 16px; }
  .aw-btn { min-height: 48px; }
  .aw-amount { min-height: 48px; }

  /* Call screen: a phone is portrait, so the remote video fills the frame and
     the self-view shrinks to a corner thumbnail clear of the controls. */
  .aw-local-video { width: 84px; height: 118px; right: 10px; bottom: 10px; }
  .aw-call-name { font-size: 19px; }
  .aw-ctl { flex: 1 1 0; max-width: 140px; }

  /* The chat header's End button must not squeeze the astrologer's name out. */
  .aw-peer-name { font-size: 16px; }
  .aw-btn-end { padding: 10px 14px; font-size: 13px; }

  /* Chat / Call / Video on the astrologer cards are the site's primary CTAs and
     are tapped with a thumb — the site's own 43px is under the 48px target. */
  .astro-card [data-aw-action],
  .astro-actions .btn-ghost,
  .astro-actions .btn-gold {
    min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .aw-amount-grid { grid-template-columns: repeat(3, 1fr); }
  .aw-resume-bar { flex-wrap: wrap; justify-content: center; text-align: center; }
  .aw-resume-text { flex: 1 1 100%; }
}

/* ---------- photo attachments in chat (aw/chat-image.js) ---------- */
/* The composer's camera button. Deliberately the same size as the Send button so
   the row does not look lopsided, and never allowed to shrink the text field
   below the 16px iOS zoom threshold noted on .aw-chat-compose input above. */
.aw-chat-attach {
  flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 999px;
  background: #f1eae5; color: var(--maroon); cursor: pointer;
  font-size: 19px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: filter .18s ease, transform .18s ease;
}
.aw-chat-attach:not(:disabled):hover { filter: brightness(.96); transform: translateY(-1px); }
.aw-chat-attach:disabled { opacity: .55; cursor: default; }

/* A photo bubble is the photo; the text padding would only box it in. */
.aw-msg.aw-msg-img { padding: 4px; white-space: normal; }
.aw-msg-photo {
  display: block; width: min(260px, 62vw); border: 0; padding: 0; cursor: zoom-in;
  border-radius: 14px; overflow: hidden; background: rgba(0,0,0,.18);
}
.aw-msg-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A photo that cannot be loaded stays visible and tappable rather than becoming
   an invisible gap that reads as "they never sent anything". */
.aw-msg-photo.is-broken { position: relative; }
.aw-msg-photo.is-broken::after {
  content: 'Photo unavailable'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); color: #fff; font-size: 12px;
}
.aw-msg.aw-msg-img .aw-msg-text { padding: 6px 8px 0; }

/* ---------- the photo editor ---------- */
/* Fixed and full-viewport, with the page behind it locked, so a touch meant for
   the crop handle cannot scroll the chat underneath. */
.aw-imgedit {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
  background: #0b0b0d; color: #fff;
  padding-bottom: env(safe-area-inset-bottom);
}
body.aw-imgedit-open { overflow: hidden; }
.aw-imgedit-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex: 0 0 auto; }
.aw-imgedit-title { flex: 1 1 auto; font-family: 'Marcellus', 'Marcellus Fallback', serif; font-size: 16px; }
.aw-imgedit-icon {
  width: 40px; height: 40px; border: 0; border-radius: 999px; background: rgba(255,255,255,.1);
  color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.aw-imgedit-text {
  border: 0; background: none; color: var(--gold); font: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer; padding: 8px;
}
.aw-imgedit-text:disabled { opacity: .4; cursor: default; }

.aw-imgedit-stage {
  position: relative; flex: 1 1 auto; min-height: 0; margin: 4px;
  /* The stage owns every gesture inside it: without this the browser treats a
     drag across the crop frame as a page pan or a pinch-zoom. */
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.aw-imgedit-stage canvas { position: absolute; inset: 0; }
.aw-imgedit-overlay { position: absolute; inset: 0; }

.aw-crop-shade { position: absolute; background: rgba(0,0,0,.62); }
.aw-crop-frame {
  position: absolute; border: 1.5px solid rgba(255,255,255,.95); cursor: move;
  /* Rule-of-thirds guides, the standard cue for "this is a crop frame". */
  background-image:
    linear-gradient(to right, rgba(255,255,255,.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.3) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}
/* Generous hit areas — fingers, not cursors. The visible corner mark is smaller
   than the square that actually receives the touch. */
.aw-crop-h {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  cursor: pointer; display: block;
}
.aw-crop-h::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-color: #fff;
}
.aw-crop-h.tl::after { left: 7px; top: 7px; border-left: 4px solid #fff; border-top: 4px solid #fff; }
.aw-crop-h.tr::after { right: 7px; top: 7px; border-right: 4px solid #fff; border-top: 4px solid #fff; }
.aw-crop-h.bl::after { left: 7px; bottom: 7px; border-left: 4px solid #fff; border-bottom: 4px solid #fff; }
.aw-crop-h.br::after { right: 7px; bottom: 7px; border-right: 4px solid #fff; border-bottom: 4px solid #fff; }

.aw-img-text {
  position: absolute; font-family: 'Manrope', 'Manrope Fallback', sans-serif; font-weight: 700;
  white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none;
}
.aw-img-text.is-editable { pointer-events: auto; cursor: move; outline: 1px dashed rgba(255,255,255,.5); outline-offset: 4px; }

/* WRAPS, it does not scroll sideways. Six colours plus three brush sizes plus
   Undo do not fit across a 360px phone, and with a horizontal scroll the Undo
   button sat off the edge where nobody would find it — a control you cannot see
   is a control you do not have. Wrapping to a second row keeps every tool on
   screen at any width. */
.aw-imgedit-tools {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 6px 12px;
  min-height: 48px; flex: 0 0 auto;
}
.aw-imgedit-chip {
  flex: 0 0 auto; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 13px; font-weight: 600;
}
.aw-imgedit-chip.is-on { background: var(--gold); color: var(--maroon); }
.aw-imgedit-swatch {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.5); padding: 0;
}
.aw-imgedit-swatch.is-on { border: 3px solid var(--gold); transform: scale(1.12); }
.aw-imgedit-brush {
  flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.12); display: inline-flex; align-items: center; justify-content: center;
}
.aw-imgedit-brush.is-on { background: rgba(255,255,255,.3); }
.aw-imgedit-brush i { display: block; border-radius: 999px; background: #fff; }
.aw-imgedit-div { flex: 0 0 auto; width: 1px; height: 24px; background: rgba(255,255,255,.25); }
.aw-imgedit-hint { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: rgba(255,255,255,.6); }

.aw-imgedit-tabs { display: flex; justify-content: center; gap: 8px; padding: 6px 0; flex: 0 0 auto; }
.aw-imgedit-tabs button {
  border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: 13px; font-weight: 600;
}
.aw-imgedit-tabs button.is-on { background: var(--gold); color: var(--maroon); }

.aw-imgedit-send {
  display: flex; gap: 8px; padding: 10px 12px; flex: 0 0 auto;
  border-top: 1px solid rgba(255,255,255,.15);
}
.aw-imgedit-send input {
  /* 16px for the same iOS reason as the chat composer: a smaller focused input
     zooms the page in and never zooms back out. */
  flex: 1 1 auto; min-width: 0; padding: 12px 16px; font: inherit; font-size: 16px;
  border: 0; border-radius: 999px; outline: none;
  background: rgba(255,255,255,.1); color: #fff;
}
.aw-imgedit-send input::placeholder { color: rgba(255,255,255,.45); }

.aw-lightbox {
  position: fixed; inset: 0; z-index: 95; background: #000;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.aw-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: default; }
.aw-lightbox-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px;
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.15); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}


/* ── Photo credit under a blog article ───────────────────────────────────────
 * Emitted by the blog agent (astrowani-backend/src/blogAgent/images.js) to
 * satisfy Unsplash's licence, which requires the photographer and Unsplash to be
 * named and linked.
 *
 * #f4d8bc IN BOTH THEMES, at the owner's explicit instruction after being shown
 * the measurement: it is 7.57:1 against the dark background and 1.10:1 against
 * the light theme's #EBCEB2, so in light mode this line is deliberately almost
 * invisible. That is the intent — a near-silent credit that satisfies the licence
 * without competing with the article. Do not "fix" the contrast.
 */
/* `.legal-content p` and `.legal-content a` (style.css:336-339) both carry
 * specificity 0,1,1, so a bare `.aw-photo-credit` at 0,1,0 loses to them and the
 * paragraph kept its inherited --ink-soft. Matching their specificity is the fix;
 * !important is not needed and would make this harder to override later. */
.legal-content .aw-photo-credit,
.legal-content .aw-photo-credit em,
.legal-content .aw-photo-credit a,
.aw-photo-credit,
.aw-photo-credit em,
.aw-photo-credit a {
  color: #f4d8bc;
}
.aw-photo-credit {
  font-size: 13.5px;
  margin-top: 26px;
}
.aw-photo-credit a { text-decoration: underline; }


/* ── Blog FAQ accordion ──────────────────────────────────────────────────────
 * Emitted by the blog agent as native <details>/<summary> (see
 * astrowani-backend/src/blogAgent/seo.js). No JavaScript: the disclosure is the
 * browser's own, so it keeps working on a page that is already fully
 * client-rendered, and a crawler reads the answers whether a panel is open or not.
 *
 * The default triangle marker is removed and replaced with our own chevron so it
 * matches the site rather than the browser.
 */
/*
 * Key Takeaways box (blog agent, 2026-11-17, adapted from claude-blog): 3-5 points
 * placed after an article's opening answer. Written by src/blogAgent/seo.js
 * takeawaysHtml(); the classes are allowlisted in src/blogPublic.js cleanContent.
 */
.legal-content .aw-takeaways,
.aw-takeaways {
  margin: 26px 0 30px;
  padding: 18px 22px 8px;
  border: 1px solid var(--gold-deep, #b48a3c);
  border-left: 4px solid var(--gold, #ffd700);
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
}
.legal-content .aw-takeaways-title,
.aw-takeaways-title {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold, #ffd700);
}
.legal-content .aw-takeaways ul,
.aw-takeaways ul { margin: 0 0 10px; padding-left: 20px; }
.legal-content .aw-takeaways li,
.aw-takeaways li { margin: 0 0 8px; line-height: 1.6; }

.legal-content .aw-faq-title,
.aw-faq-title { margin-top: 44px; }

.legal-content .aw-faq-list,
.aw-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.legal-content .aw-faq,
.aw-faq {
  border: 1px solid var(--border-soft, rgba(89, 42, 25, .16));
  border-radius: 14px;
  background: rgba(255, 255, 255, .34);
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease;
}
.legal-content .aw-faq[open],
.aw-faq[open] {
  background: rgba(255, 255, 255, .55);
  border-color: var(--gold, #c79a4e);
}

.legal-content .aw-faq > summary,
.aw-faq > summary {
  list-style: none;              /* Firefox */
  cursor: pointer;
  padding: 15px 48px 15px 18px;
  position: relative;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--maroon, #592a19);
  user-select: none;
}
/* The default disclosure triangle, in every engine that still draws one. */
.aw-faq > summary::-webkit-details-marker { display: none; }
.aw-faq > summary::marker { content: ''; }

/* Our own chevron, rotating open. */
.legal-content .aw-faq > summary::after,
.aw-faq > summary::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid var(--gold-deep, #a4762b);
  border-bottom: 2px solid var(--gold-deep, #a4762b);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.legal-content .aw-faq[open] > summary::after,
.aw-faq[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }

.legal-content .aw-faq > summary:hover,
.aw-faq > summary:hover { color: var(--gold-deep, #a4762b); }
.aw-faq > summary:focus-visible { outline: 2px solid var(--gold, #c79a4e); outline-offset: -2px; }

.legal-content .aw-faq > p,
.aw-faq > p {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 14.5px;
  line-height: 1.75;
}

@media (max-width: 560px) {
  .aw-faq > summary { padding: 13px 42px 13px 14px; font-size: 14.5px; }
  .aw-faq > p { padding: 0 14px 14px; }
}
