/* ===========================================================================
   account.css — HALCYON CLEARANCE — customer portal (CONCEPT DRAFT)  ·  W2 page-scoped
   ---------------------------------------------------------------------------
   Page-scoped styles ONLY. Reuses the shared design-system tokens + primitives
   from styles.css (--ink-900 / --amber / .btn / .container / .concept-ribbon …),
   which is INTEGRATOR-owned and must not be edited here. Everything below is
   namespaced to the /app/ (account.html) surface.
   Self-contained: system-font stack, no external fonts/CDNs, no remote assets.
   ========================================================================= */

/* ---------- portal shell ---------- */
.portal {
  min-height: calc(100vh - var(--ribbon-h) - 60px);
  padding: 34px 0 72px;
  background:
    radial-gradient(1100px 420px at 80% -10%, rgba(242,169,0,.08), transparent 60%),
    var(--canvas);
}
.portal .container { max-width: 960px; }
/* W5.3: every .btn-sm INSIDE the portal (acct-strip's Account, view-head's
   back/+New-request, prefs' Save preferences, session's Sign out) measured
   35px tall at phone widths — below the 44px floor. styles.css owns .btn-sm
   globally (out of scope); .portal is this page's own container, so this
   can't reach the shared .site-header outside it (header fixes are owned
   elsewhere). */
.portal .btn-sm { min-height: 44px; }

.portal-view { display: none; }
.portal-view.active { display: block; }

.view-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.view-head h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0; }
.view-head .spacer { flex: 1 1 auto; }

/* ---------- account status strip ---------- */
.acct-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 22px;
  box-shadow: 0 10px 26px -22px rgba(17,24,32,.4);
}
.acct-strip .who { font-weight: 700; color: var(--ink-900); }
.acct-strip .who small { display: block; font-weight: 500; color: var(--ink-soft); font-size: .82rem; }
.acct-badge {
  font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
}
.acct-badge.guest { background: #fff4d6; color: #7a5600; }
.acct-badge.member { background: #e2f0e6; color: #1f6b39; }
.acct-strip .spacer { flex: 1 1 auto; }

/* ---------- not-open-yet gate ---------- */
.not-open {
  max-width: 560px; margin: 40px auto; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 30px; box-shadow: var(--shadow-card);
}
.not-open .ic { font-size: 2.6rem; margin-bottom: 8px; }
.not-open h1 { font-size: 1.5rem; }
.not-open p { max-width: 42ch; margin: 0 auto 1em; }

/* ---------- auth card ---------- */
.auth-card {
  max-width: 460px; margin: 24px auto; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; box-shadow: var(--shadow-card);
}
.auth-card h1 { font-size: 1.55rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--ink-soft); margin-bottom: 20px; }

.seg {
  display: flex; background: var(--slate-soft); border-radius: 10px;
  padding: 4px; gap: 4px; margin-bottom: 20px;
}
.seg button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--ink-soft); min-height: 44px; /* W5.3: measured 43px */
  padding: 9px 8px; border-radius: 7px; transition: background .15s var(--ease), color .15s var(--ease);
}
.seg button[aria-selected="true"] { background: var(--white); color: var(--ink-900); box-shadow: 0 2px 8px -4px rgba(17,24,32,.3); }

.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 700; font-size: .9rem; color: var(--ink-900); margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: 9px; background: #FCFDFE; color: var(--ink);
}
.field input:focus-visible { border-color: var(--amber); }
.field input.invalid { border-color: var(--red); background: #fff6f5; }

.or-rule {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 16px;
  color: var(--ink-soft); font-size: .84rem;
}
.or-rule::before, .or-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.form-msg {
  display: none; margin: 4px 0 14px; padding: 10px 12px; border-radius: 8px;
  font-size: .88rem; font-weight: 600;
}
.form-msg.show { display: block; }
.form-msg.err { background: #fdecea; color: var(--red); }
.form-msg.ok  { background: #e2f0e6; color: #1f6b39; }

/* ---------- request list ---------- */
.req-list { display: grid; gap: 14px; }
.req-card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; font: inherit; color: inherit;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), border-color .15s ease;
}
.req-card:hover { border-color: #cdd6df; box-shadow: 0 16px 30px -20px rgba(17,24,32,.4); }
@media (hover: hover) and (pointer: fine) { .req-card:hover { transform: translateY(-2px); } }
.req-card .row1 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.req-card .ref { font-weight: 800; color: var(--ink-900); }
.req-card .when { font-size: .875rem; color: var(--ink-soft); margin-left: auto; } /* W5.3: 14px reading floor (was .8rem/12.8px) */
.req-card .summary { color: var(--ink-soft); font-size: .92rem; margin-bottom: 10px; }

/* ---------- status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 800; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-new       { background: #EEF2F6; color: #5a6b7b; }
.pill.s-quoted    { background: #fff4d6; color: #8a6200; }
.pill.s-accepted  { background: #EBF0F4; color: #415B79; }
.pill.s-scheduled { background: #EBF0F4; color: #415B79; }
.pill.s-progress  { background: #e9e3fb; color: #5b3ea6; }
.pill.s-complete  { background: #e2f0e6; color: #1f6b39; }
.pill.s-declined, .pill.s-cancelled { background: #fdecea; color: var(--red); }

/* ---------- status timeline ---------- */
.timeline {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 0; margin: 8px 0 26px; overflow-x: auto; padding-bottom: 6px;
}
.tl-step { position: relative; text-align: center; padding-top: 26px; min-width: 84px; }
.tl-step::before {
  content: ""; position: absolute; top: 7px; left: 50%; width: 100%; height: 3px;
  background: var(--line);
}
.tl-step:last-child::before { display: none; }
.tl-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%; background: var(--white);
  border: 3px solid var(--line); z-index: 1;
}
.tl-label { font-size: .74rem; font-weight: 700; color: var(--ink-soft); }
.tl-step.done .tl-dot { background: var(--amber); border-color: var(--amber); }
.tl-step.done::before { background: var(--amber); }
.tl-step.current .tl-dot { background: var(--ink-900); border-color: var(--ink-900); box-shadow: 0 0 0 4px rgba(17,24,32,.15); }
.tl-step.current .tl-label { color: var(--ink-900); }
.tl-step.cancelled .tl-dot { background: var(--red); border-color: var(--red); }
/* mobile: 6 fixed-width steps (84px each) overflow a phone — collapse to fit the card,
   shrink the label + dot so all six divide the available width with no page scroll.
   This compact form stays as the DASHBOARD card's decorative mini-timeline (aria-hidden,
   redundant with the status pill right above it) — see the .detail-block override below
   for the one place this text is the customer's PRIMARY read of their job's progress. */
@media (max-width: 560px) {
  .timeline { overflow-x: visible; gap: 3px; margin-bottom: 22px; }
  .tl-step { min-width: 0; padding-top: 22px; }
  .tl-dot { width: 14px; height: 14px; }
  .tl-step::before { top: 6px; height: 2px; }
  .tl-label { font-size: .58rem; line-height: 1.12; letter-spacing: -.015em; }

  /* W5.3: the request-DETAIL page's own timeline (role="list") is the
     customer's primary read of where their job stands — 9.28px there fails
     the 14px reading floor. Rather than shrink further, give it real text
     and a CONTAINED horizontal scroll (the .timeline box itself, never the
     page) — a wider min column plus the base rule's overflow-x:auto (only
     narrowed to :visible above for the compact card variant). */
  .detail-block .timeline {
    overflow-x: auto; grid-auto-columns: minmax(78px, 1fr); gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .detail-block .tl-step { min-width: 78px; padding-top: 24px; }
  .detail-block .tl-dot { width: 15px; height: 15px; }
  .detail-block .tl-label { font-size: .875rem; line-height: 1.15; letter-spacing: -.005em; }
}

/* ---------- detail blocks ---------- */
.detail-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; margin-bottom: 18px;
}
.detail-block h2 { font-size: 1.1rem; margin-bottom: 12px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: .93rem; }
.dl dt { font-weight: 700; color: var(--ink-900); }
.dl dd { margin: 0; color: var(--ink-soft); }

/* ---------- quote box ---------- */
.quote-box {
  background: linear-gradient(135deg, var(--ink-900), var(--ink-800));
  color: var(--white); border-radius: 14px; padding: 22px 24px; margin-bottom: 18px;
}
.quote-box h2 { color: var(--white); font-size: 1.05rem; margin-bottom: 6px; }
.quote-box .amount { font-size: 2.2rem; font-weight: 900; color: var(--amber); line-height: 1.1; }
.quote-box .amount small { display: block; font-size: .875rem; color: #E0E7EE; font-weight: 600; } /* W5.3: 14px floor (was .8rem) */
.quote-box .q-notes { color: #E0E7EE; font-size: .9rem; margin: 8px 0 16px; }
.quote-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* itemised quote breakdown — shown whenever the staff quote carries lines;
   a discount line (negative amount) is styled distinctly so it reads as
   money OFF the total, not just another charge. */
.quote-lines { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 4px; }
.quote-box .quote-lines { border-top: 1px solid rgba(255,255,255,.18); padding-top: 10px; }
.quote-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.quote-box .quote-lines li { color: #E0E7EE; }
.detail-block .quote-lines li { color: var(--ink-soft); }
.quote-lines li.ql-line-discount { font-weight: 700; }
.quote-box .quote-lines li.ql-line-discount { color: var(--amber); }
.detail-block .quote-lines li.ql-line-discount { color: var(--status-ok-ink); }

/* ---------- payment surface (W4 deposit checkout -> W5.3 model v2) ----------
   PAYMENT MODEL v2 (operator 2026-07-25): one full payment, taken at the
   quote. The class name .pay-box replaces .deposit-box; .deposit-box is kept
   as an alias on every selector below because the account page can still be
   rendering a deposit-era job (see account.js isLegacyDepositJob) and a
   customer with a live legacy job must not get an unstyled panel. */
.pay-box, .deposit-box { margin-bottom: 18px; }

/* active checkout — ink sheet, echoes the quote-box treatment */
.pay-box.due, .deposit-box.due {
  background: linear-gradient(135deg, var(--ink-900), var(--ink-800));
  color: var(--white); border-radius: 14px; padding: 22px 24px;
}
.pay-box.due h2, .deposit-box.due h2 { color: var(--white); font-size: 1.05rem; margin-bottom: 6px; }
.dep-amount { font-size: 2.2rem; font-weight: 900; color: var(--amber); line-height: 1.1; }
.dep-amount small { display: block; font-size: .875rem; color: #E0E7EE; font-weight: 600; margin-top: 2px; } /* W5.3: 14px floor (was .78rem) */
.dep-sheet { margin: 16px 0 6px; min-height: 46px; }
.dep-foot { color: #E0E7EE; font-size: .875rem; margin: 6px 0 0; } /* W5.3: 14px floor (was .82rem) */

/* gated fallback (no live SDK) + loading, both live inside the ink sheet */
.dep-fallback { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 14px 16px; }
.dep-fallback-lead { font-weight: 700; color: var(--white); margin: 0 0 4px; font-size: .95rem; }
.dep-fallback-sub { color: #E0E7EE; font-size: .875rem; margin: 0; } /* W5.3: 14px floor (was .84rem) */
.dep-paypal-loading { color: #E0E7EE; font-size: .88rem; padding: 12px 2px; }

/* Square hosted-link panel (Payments Phase 2) — retargeted 2026-07-25 from the
   never-enabled Revolut rail ("Square will replace revolut"). Sits alongside
   the PayPal sheet inside the same dark .deposit-box.due ink sheet, so it
   reuses that panel's light-on-dark palette. */
.dep-square { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.16); }
.dep-square-lead { font-weight: 700; color: var(--white); margin: 0 0 8px; font-size: .95rem; }
.dep-square-sub { color: #E0E7EE; font-size: .875rem; margin: 0 0 10px; }
.dep-square-link {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
  color: var(--amber); text-decoration: underline; text-underline-offset: 3px;
}
.dep-square-link:hover { color: var(--amber-2); }
.dep-square-note { color: #E0E7EE; font-size: .875rem; margin: 8px 0 0; }
.dep-square-form { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dep-square-form label { flex-basis: 100%; font-weight: 700; font-size: .875rem; color: #E0E7EE; }
.dep-square-form input {
  flex: 1 1 200px; min-width: 0; font: inherit; padding: 11px 13px;
  border: 1.5px solid rgba(255,255,255,.3); border-radius: 9px;
  background: rgba(255,255,255,.94); color: var(--ink);
}
.dep-square-form input:focus-visible { border-color: var(--amber); }
.dep-square-msg { color: #ffd7d2; font-size: .875rem; margin: 8px 0 0; }
.dep-square-fallback { margin-top: 14px; }
.dep-square-done .dep-line { color: var(--white); }

/* ---------- EMBEDDED Square pay surface (W5.3) ----------------------------
   Operator ruling D1=(b), 2026-07-25 — the card form lives INSIDE our page.
   It sits in the same dark .pay-box.due ink sheet as the hosted-link panel
   did, so it inherits that light-on-dark palette.

   Square renders the card fields in a cross-origin IFRAME we cannot style
   from here — only its container. That is why the host below is a light,
   generously padded card rather than a dark one: Square's own field styling
   is light by default, and a dark box around light fields reads as a broken
   embed. Do not try to reach inside #pay-card-host; you cannot, and the SDK
   has its own style API for that if it is ever wanted.
   ------------------------------------------------------------------------ */
.pay-panel { margin-top: 4px; }
.pay-wallets { display: grid; gap: 8px; margin-bottom: 12px; }
.pay-wallet-btn { min-height: 48px; }         /* Square sizes the button itself */
.pay-or {
  display: flex; align-items: center; gap: 12px;
  color: #E0E7EE; font-size: .875rem; margin: 0 0 12px;
}
.pay-or::before, .pay-or::after {
  content: ""; flex: 1 1 auto; height: 1px; background: rgba(255,255,255,.22);
}
.pay-card-host {
  background: var(--white); border-radius: 10px; padding: 14px;
  min-height: 92px;
}
.pay-loading { color: var(--ink-soft); font-size: .875rem; margin: 0; }
.pay-submit { margin-top: 14px; }
.pay-msg { color: #ffd7d2; font-size: .875rem; margin: 10px 0 0; }
.pay-safe { color: #E0E7EE; font-size: .875rem; margin: 10px 0 0; }
.pay-alt { color: #E0E7EE; font-size: .875rem; margin: 8px 0 0; }
.pay-alt a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.pay-note {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px; padding: 10px 12px; color: #E0E7EE;
  font-size: .875rem; margin: 0 0 12px;
}
.pay-hosted-sub { color: #E0E7EE; font-size: .875rem; margin: 10px 0 0; }
.pay-hosted-link { margin-top: 4px; }
.pay-done .dep-line { color: var(--white); }

/* start-early consent (reg 36(6)) — flag-gated OFF until the wording is
   approved; styled now so switching it on is a one-line config change and
   not a layout surprise on a live money screen. */
.pay-consent {
  display: flex; gap: 10px; align-items: flex-start;
  color: #E0E7EE; font-size: .875rem; margin: 14px 0 0; cursor: pointer;
}
.pay-consent input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }

/* paid-pending + confirmed states — light detail-block cards */
.pay-box.pending, .deposit-box.pending { border-color: #d8c48a; background: #fffaf0; }
.pay-box.confirmed, .pay-box.booked,
.deposit-box.confirmed, .deposit-box.booked { border-color: #b7ddc3; background: #f2faf5; }
/* refunded — money went BACK. Deliberately neither green (that reads as
   "all good, paid") nor red (nothing has gone wrong): its own neutral tone,
   so a customer scanning the page cannot mistake a refund for a payment. */
.pay-box.refunded { border-color: #cbd5e1; background: #f6f8fb; }
.pay-sub { font-size: .875rem; color: var(--ink-soft); margin: 8px 0 0; }
.dep-line { font-size: .95rem; color: var(--ink); margin: 0; display: flex; gap: 8px; align-items: baseline; }
.dep-tick {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%; background: #1f6b39; color: #fff;
  font-size: .74rem; font-weight: 900; transform: translateY(2px);
}
.dep-ref { font-size: .875rem; color: var(--ink-soft); margin: 8px 0 0; font-variant-numeric: tabular-nums; } /* W5.3: 14px floor (was .8rem) — the payment reference the customer needs to quote */
.dep-spin {
  display: inline-block; flex: none; width: 15px; height: 15px; border-radius: 50%;
  border: 3px solid #e4d3a0; border-top-color: #b8860b; transform: translateY(3px);
  animation: spin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .dep-spin { animation: none; } }

/* ---------- documents (invoices + WTN receipts) — read-only ---------- */
.docs-hint { font-size: .86rem; color: var(--ink-soft); margin: 4px 0 0; line-height: 1.5; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FCFDFE;
}
.dr-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dr-ic { flex: none; font-size: 1.05rem; }
.dr-no { font-weight: 700; font-size: .88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-stat {
  flex: none; font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: #EAEEF3; color: var(--ink-900); border: 1px solid #D1DBE6;
}
.doc-stat.issued { background: var(--status-warn-bg); color: var(--status-warn-ink); border-color: var(--status-warn-line); }
.doc-stat.paid   { background: var(--status-ok-bg); color: var(--status-ok-ink); border-color: var(--status-ok-line); }
.doc-stat.wtn    { background: #eaf3ee; color: var(--status-ok-ink); border-color: #cfe6d7; }
.dr-act { display: flex; gap: 6px; flex: none; }
/* W5.3: a long invoice/WTN number + status pill + action button crowd one
   342px row at phone widths, squashing dr-no's own ellipsis down to 1-2
   characters (parity fix — same finding + fix as staff.css's .doc-row). */
@media (max-width: 560px) {
  .doc-row { flex-wrap: wrap; row-gap: 8px; }
  .dr-main { flex: 1 1 100%; }
  .dr-act { flex: 1 1 100%; justify-content: flex-end; }
}
.chip-act {
  position: relative;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: .8rem; font-weight: 700; color: var(--ink-900); cursor: pointer;
}
/* ~27px visible chip, ≥44px effective target (W5.3 — mirrors staff.css's
   .chip-act, which already carries this; this file's copy was missing it). */
.chip-act::before { content: ""; position: absolute; inset: -11px -2px; }
.chip-act:hover { background: var(--slate-soft); }
.chip-act:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 2px; }

/* ---------- evidence chain (driver jobPhotos) — read-only ---------- */
.ev-hint { font-size: .88rem; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.ev-count { font-size: .875rem; font-weight: 800; color: var(--ink-900); margin: 0 0 10px; letter-spacing: .01em; } /* W5.3: 14px floor (was .8rem) */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 10px; }
.ev-tile { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #FCFDFE; }
.ev-tile img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.ev-tile .ev-ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; color: #b7c2ce; font-size: 1.4rem; background: repeating-linear-gradient(45deg, #F5F7F9, #F5F7F9 8px, #EEF2F6 8px, #EEF2F6 16px); }
/* W5.3: 14px floor on the phase label (was .78rem/12.48px) — the nested span
   (upload timestamp) keeps its own smaller size on purpose: secondary meta,
   same convention as .msg .meta below. */
.ev-tile figcaption { display: block; padding: 7px 9px; font-size: .875rem; font-weight: 700; color: var(--ink-900); line-height: 1.3; }
.ev-tile figcaption span { display: block; font-weight: 500; color: var(--ink-soft); font-size: .72rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ev-tile figcaption .ev-miss { color: #9aa7b4; font-style: italic; }
.ev-tile.missing { border-style: dashed; }

/* ---------- photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photo-empty { color: var(--ink-soft); font-size: .9rem; }

/* ---------- messages ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; max-height: 380px; overflow-y: auto; padding: 4px; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 13px; font-size: .92rem; line-height: 1.4; }
.msg .meta { display: block; font-size: .7rem; margin-top: 4px; opacity: .7; }
.msg.mine { align-self: flex-end; background: var(--ink-900); color: var(--white); border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--slate-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-empty { color: var(--ink-soft); font-size: .9rem; text-align: center; padding: 16px; }
.msg-photo { display: block; max-width: 100%; max-height: 200px; border-radius: 10px; margin-bottom: 6px; cursor: zoom-in; object-fit: cover; }
.msg-photo:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 2px; }
/* .msg.mine's bubble is an ink-900 ground (see .msg.mine above) — an ink ring
   there would be invisible. Amber is compliant on that dark ground (~8.6:1),
   so restore it just for this variant instead of a one-size ink ring. */
.msg.mine .msg-photo:focus-visible { outline-color: var(--amber); }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.composer textarea {
  flex: 1; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; resize: vertical; min-height: 46px; max-height: 160px;
}
.composer textarea:focus-visible { border-color: var(--amber); }
.btn-attach {
  flex: none; width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-attach:hover { background: var(--slate-soft); }
.btn-attach:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 2px; }
.btn-attach:disabled { opacity: .55; cursor: default; }
.msg-preview-chip {
  position: relative; display: inline-flex; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--line);
}
.msg-preview-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-preview-remove {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(17,24,32,.82); color: #fff; font-size: .7rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
/* the visible badge stays a small 20px circle on the 64px thumbnail; the real
   hit target grows to the 44px minimum via an invisible pseudo (matches the
   same fix on staff.css's .attach-remove). */
.msg-preview-remove::before { content: ""; position: absolute; inset: -12px; }

/* ---------- full-size photo overlay (messages) ---------- */
.msg-img-overlay {
  position: fixed; inset: 0; background: rgba(17,24,32,.86); display: flex; align-items: center;
  justify-content: center; padding: 24px; z-index: 900;
}
.msg-img-overlay[hidden] { display: none; }
.msg-img-overlay img { max-width: min(92vw, 900px); max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }

/* ---------- prefs / consent ---------- */
.consent-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.consent-row input { margin-top: 4px; flex: none; }
.consent-row label { font-size: .9rem; color: var(--ink-soft); }
.consent-row label strong { color: var(--ink-900); }

/* ---------- empty / loading ---------- */
.empty-state, .loading-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.empty-state .ic { font-size: 2.4rem; margin-bottom: 8px; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 12px;
  border: 3px solid var(--line); border-top-color: var(--amber);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.footnote { text-align: center; color: var(--ink-soft); font-size: .8rem; padding: 24px 16px 40px; max-width: 720px; margin: 0 auto; }

/* W5.3: account.html sets .hint paragraphs' font-size inline (.78rem/.8rem —
   HTML we don't edit here); !important is the only lever CSS has over an
   inline style, and 14px is a genuine reading-floor fix (guest-continue
   note, SMS/WhatsApp consent note), not a cosmetic override. */
.hint { font-size: .875rem !important; }

/* =========================================================================
   Money-figure + chip typography — customer portal. Matches the estate's money
   treatment (Hanken display + tabular numerals) and uppercase micro-labels.
   The F7 "Material Science" overlay (mono readouts + instrument-grid on the ink
   money sheets) was retired estate-wide in the 2026-07-13 redesign; this page —
   the last holdout — is brought into line here. Mono now lives only on the
   internal operator surfaces (driver.css / staff.css), by design.
   ========================================================================= */
.quote-box .amount, .dep-amount, .dep-ref, .req-card .ref, .doc-stat,
.acct-badge, .pill { font-family: var(--display); }
.quote-box .amount, .dep-amount, .dep-ref, .req-card .ref { font-variant-numeric: tabular-nums; }
.detail-block h2, .d-section h3, .view-head h1 { letter-spacing: -.01em; }
