/* PawnLoans — ported from Pawn Marketplace v3.0.1 (2026-10-06), translated to v3.1 conventions. */

/* Pages/PawnLoans.razor (/pawn_loans), Pages/PawnLoanDetail.razor (/pawn_loans/{Id}) and
   Pages/LoanHistory.razor (/pawn_loan_history).

   Brought from v3.0.1: the features and the motion timings (accordion 0.3s
   cubic-bezier(.25,.46,.45,.94), chevron 0.2s ease, card state 0.15s, sort icon 0.2s, linked-row
   hover 0.15s). Everything else speaks v3.1:
   - Reused as they are, not restyled here: .fc-item-bar / .fc-item-bar-inner / .fc-item-back (back
     bar, ItemDetails.css), .fc-item-empty / -icon / -title / .fc-item-cta (not found, ItemDetails.css),
     .fc-item-storelink (link-button look, ItemDetails.css) and .profile_heading_cls (page heading,
     ProfileMenu.css). The Loan History card is v3.0.1's own, copied exactly (Kelly, 2026-10-07).
     Inherited off-scale value, listed and not swept: .fc-item-back's 4px icon gap.
   - Spacing: Momento 8px scale only (spec §5). Text: Momento type tokens; v3.0.1's 12px text is 14px
     (--text-label-md), as Kelly ruled for Profile (Momento has no 12px text token).
   - Chips are Momento pills: 0 8px in a 24px line box; the detail status pill 0 16px, 32px.
   - Hover only on a real pointer, and only on the linked table rows and the Loan History card (v3.1
     accordion heads have none). Reduced motion turns every transition here off. */

/* ── Page root ────────────────────────────────────────────────────────────────────────────────
   State colours as one-line properties (spec §2): one urgency red and one due-soon colour for the list
   chips, card borders, the detail status pill and Next Due. v3.0.1 used two reds for one state
   (#E22721 list, about 3.6:1 as chip text on its tint; #B50407 detail) and two due-soon colours
   (#b8860b list, about 2.9:1; #E67E22 detail, about 2.4:1). Approved by Kelly, 2026-10-07:
     --fc-loan-urgent  #B50407 (brand red): 5.2:1 as chip text on the overdue card tint.
     --fc-loan-soon    #8A5A00 (dark amber): 4.6:1 as chip text on the due-soon card tint.
     --fc-loan-ok      #0A6C20, darkened from v3.0.1's #0D8728 to meet WCAG AA (Kelly, 2026-10-07: "Meet
                       WCAG requirements"). Worst case 4.68:1: the Paid Off detail pill on the page
                       gradient's #D8EAFF top; 4.87:1 as chip text on an open ticket's blue tint, 5.68:1
                       on a white card, 6.17:1 as the Amount Paid stat on the #F7F7F7 tile. #0D8728 was
                       3.4-4.3:1 there. The same value is used on the Layaway pages. */
.fc-pawn {
  --fc-loan-urgent: var(--color-brand-accent);
  --fc-loan-soon: #8a5a00;
  --fc-loan-ok: #0a6c20;
  --fc-pawn-tabclear: 0px;
  /* Profile / Campaign gradient and height, minus the native header and tab bar (Stores precedent,
     same as the sign-in page in AccountLinking.css). Flex column so a short page still puts the
     phone summary drawer at the bottom of the screen (see the ≤767 block). */
  display: flex;
  flex-direction: column;
  min-height: calc(
    100dvh - var(--fc-appbar-h, 0px) - var(--native-header-h, 0px) -
      var(--fc-pawn-tabclear)
  );
  background: linear-gradient(
    to bottom,
    var(--color-surface-info-bg) 0%,
    var(--color-surface-subtle) 100%
  );
}
.page.has-bottomnav .fc-pawn {
  --fc-pawn-tabclear: calc(56px + var(--fc-tabbar-pad-bottom));
}

/* Desktop: the back bar and the sticky summary offset by the header only (no Set Location bar on these
   pages), with the 100px fallback so nothing animates on a direct load (CampaignsItemPage.css).
   That inherited v3.1 issue — on an iPad in landscape (≥1025px) there is no desktop header, so
   nothing sets --fc-appbar-h and the 100px fallback pushed the back bar and the sticky summary
   100px below the native header — is now MEASURED AND FIXED by the native-shell rule below
   (sticky top 157px → 57px on an iPad). Item Detail (ItemDetails.css, 88px), Campaign
   (CampaignsItemPage.css) and Layaway.css carry the same rule. */
@media (min-width: 1025px) {
  .fc-pawn {
    --fc-header-h: var(--fc-appbar-h, 100px);
  }
  html.fc-header-hidden .fc-pawn {
    --fc-header-h: 0px;
  }
  /* Confirmed on an
     iPad: --fc-appbar-h is unset in the native shell, so the fallback resolves to the literal
     100px and the back bar plus every sticky column pin that far below where the native header
     actually ends; fc-header-hidden is a desktop class that never fires on native, so nothing
     resets it. Hold the <=1024 value — the native header's height is already paid by the scroll
     container's padding. The same rule is now in ItemDetails.css and Layaway.css. */
  html.fc-native-shell .fc-pawn {
    --fc-header-h: 0px;
  }
}

/* iOS: paint the gradient once on a viewport-fixed layer, not on every scroll frame (ProfileMenu.css). */
@supports (-webkit-touch-callout: none) {
  .fc-pawn {
    background: none;
    position: relative;
    z-index: 0;
  }
  .fc-pawn::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      var(--color-surface-info-bg) 0%,
      var(--color-surface-subtle) 100%
    );
  }
}

/* Page insets 16 / 16 / 48, sides 32 from 834px: Profile's Momento grid margin, the same as the
   sign-in page these routes show when signed out, so nothing shifts between the two. */
.fc-pawn-inner {
  flex: 1 0 auto;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-2) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (min-width: 834px) {
  .fc-pawn-inner {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.fc-pawn-title {
  margin: 0;
}

/* Count next to a heading: "(7) Tickets", "(9) Past Pledges" (Saved's "(n) Items" look). */
.fc-pawn-count {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: var(--text-action-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-action-md-lh);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Loan History page header: h1 left, count right. Wraps (count under the heading) when a long
   heading, e.g. Spanish "Historial de préstamos", leaves no room on a phone. */
.fc-pawn-histhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
}

/* Two columns from 768px with a 16px gap (Item Detail precedent); stacked on phones. */
.fc-pawn-grid {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (min-width: 768px) {
  .fc-pawn-grid {
    flex-direction: row;
    align-items: flex-start;
  }
}
.fc-pawn-col {
  flex: 1 0 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (min-width: 768px) {
  .fc-pawn-col {
    flex: 1 1 0;
  }
}

/* ── Loan History card ── v3.0.1's card copied exactly (Kelly, 2026-10-07: "make it look EXACTLY like
   pic #3 ... I want that exact copy"), from v3.0.1 CSS/Pages/PawnLoans.css:26-32; the tokens it uses
   have the same values in both projects. Named exception to the 8px scale: v3.0.1's 12px gap and
   12px vertical padding, and its 22/20px line heights. v3.1 only gates the hover tint to mouse-type
   pointers (so it can't stick after a tap) and keeps its own press and focus ring on the <button>. */
.fc-pawn-history {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px var(--space-2);
  background: var(--color-surface-default);
  box-shadow: inset 0 0 0 1px var(--color-border);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition:
    box-shadow 0.15s,
    background-color 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .fc-pawn-history:hover {
    background: rgba(0, 0, 0, 0.02);
  }
}
.fc-pawn-history-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-brand-primary) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  font-size: 24px;
  flex-shrink: 0;
}
.fc-pawn-history-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.fc-pawn-history-title {
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
  line-height: 22px;
}
.fc-pawn-history-desc {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  color: var(--color-text-muted);
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-pawn-history-chev {
  color: var(--color-text-muted);
  font-size: 20px;
}
/* Phones: the subtitle wraps instead of ending in "…" (Kelly, 2026-10-07). */
@media (max-width: 767px) {
  .fc-pawn-history-desc {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* "My Active Loans" + count */
.fc-pawn-listhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
}
.fc-pawn-listhead-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-heading-md-size);
  font-weight: var(--fw-xbold);
  line-height: var(--text-heading-md-lh);
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
}

/* v3.1 text-only empty state (Saved family). Muted token instead of Saved's #B3B3B3 literal, which is
   about 2:1 on white. */
/* FCLoader while the active-loans call is in flight. */
.fc-pawn-loading {
  padding: var(--space-4) 0;
}

.fc-pawn-empty {
  margin: 0;
  padding: var(--space-3) var(--space-2);
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-muted);
}

/* ── Ticket accordion card ────────────────────────────────────────────────────────────────────
   Border drawn as an inset shadow so the 2px state rings move no layout. No overflow:hidden: the
   panel clips itself, and the card's focus ring must not be cut off. */
.fc-pawn-ticket {
  border-radius: var(--radius-lg);
  background: var(--color-surface-default);
  box-shadow: inset 0 0 0 1px var(--color-border);
  transition:
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}
.fc-pawn-ticket--overdue {
  box-shadow: inset 0 0 0 2px var(--fc-loan-urgent);
  background: color-mix(
    in srgb,
    var(--fc-loan-urgent) 7%,
    var(--color-surface-default)
  );
}
.fc-pawn-ticket--soon {
  box-shadow: inset 0 0 0 2px var(--fc-loan-soon);
  background: color-mix(
    in srgb,
    var(--fc-loan-soon) 8%,
    var(--color-surface-default)
  );
}
.fc-pawn-ticket--active.is-open {
  box-shadow: inset 0 0 0 2px var(--color-brand-primary);
  background: color-mix(
    in srgb,
    var(--color-brand-primary) 10%,
    var(--color-surface-default)
  );
}

/* Focus: Momento Block accordion (Accessibility.css precedent for .fc-item-acc). The card's border
   becomes 2px #4B4B4B and the head draws nothing itself. On a card that already carries a coloured
   2px state ring, the grey ring sits 2px outside it so the state colour stays visible.
   The !important is needed because Accessibility.css's v3.0.2 button outline is (0,29,1) and loads
   after this file; the cleaner fix is adding .fc-pawn-ticket-head to that rule's :not() list
   (reported for the orchestrator), after which the !important can go. The transparent outline keeps
   focus visible in forced-colours mode. */
.fc-pawn-ticket-head:focus-visible {
  outline: 2px solid transparent !important;
}
.fc-pawn-ticket:has(> .fc-pawn-ticket-head:focus-visible) {
  outline: 2px solid var(--fc-focus-grey, #4b4b4b);
  outline-offset: -2px;
}
.fc-pawn-ticket--overdue:has(> .fc-pawn-ticket-head:focus-visible),
.fc-pawn-ticket--soon:has(> .fc-pawn-ticket-head:focus-visible),
.fc-pawn-ticket--active.is-open:has(> .fc-pawn-ticket-head:focus-visible) {
  outline-offset: 2px;
}

/* Head: a real <button> (v3.1 accordion heads). Spans inside, so no inner layout element is a div. */
.fc-pawn-ticket-head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-2);
  background: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

/* Ticket thumbnail (Components/PawnTicketThumb.razor; Kelly, 2026-10-07).
   No pictures: the ticket number in Pawn Marketplace Blue on v3.1's light blue, in the collage's 56px box.
   Even left/right padding keeps the number off the edges. A longer number widens the box (up to 96px)
   instead of being clipped; past that it wraps onto a second line, and the box grows taller if needed
   (e.g. enlarged system text). */
.fc-pawn-thumb-number {
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 56px;
  max-width: 96px;
  min-height: 56px;
  padding: calc(var(--space-1) / 2) var(--space-1);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-wrap: anywhere;
  background: var(--color-surface-info-bg);
  color: var(--color-brand-primary);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-label-md-lh);
}
/* Top-aligned in the accordion head, level with the ticket title, not centred (Kelly, 2026-10-07). */
.fc-pawn-ticket-head > .fc-pawn-thumb-number,
.fc-pawn-ticket-head > .fc-pawn-collage {
  align-self: flex-start;
}
/* Pictures: v3.0.1's collage, 1 = single, 2 = side by side, 3 = one tall + two stacked, 4+ = 2×2 ("+N" in
   the 4th cell). The 1px gap is a hairline grid line (component border, kept from v3.0.1). Photos are
   cropped to fill (v3.0.1's object-fit: cover, Kelly's image #2); ImageFallback.css loads before this file. */
.fc-pawn-collage {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
}
.fc-pawn-collage--1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.fc-pawn-collage--2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
.fc-pawn-collage-tall {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.fc-pawn-collage img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  background: var(--color-surface-default);
}
.fc-pawn-collage-more {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  color: var(--color-surface-default);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-label-md-lh);
}

.fc-pawn-ticket-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}
.fc-pawn-ticket-no {
  max-width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-body-md-lh);
  letter-spacing: 0.2px;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-pawn-closed {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}

/* Store line: plain muted text in v3.1's .product-card-store look. v3.0.1 drew it as an underlined
   link that did nothing; a link can't sit inside the head button anyway. */
.fc-pawn-store {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  min-width: 0;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}
.fc-pawn-store i {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.fc-pawn-store-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-pawn-store-name {
  font-weight: var(--fw-bold);
}

.fc-pawn-ticket-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  flex-shrink: 0;
}
.fc-pawn-amount-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
/* "Transaction #2224431926" under the amount: the store line's muted label style. */
.fc-pawn-transnum {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Narrow ticket list, Pawn Loans only (#pawn-loans-container; Loan History shares these classes and is
   unchanged). With 10-digit ticket numbers the three-column head (number box | details | badge, amount,
   transaction #) left the details a sliver ("Ti…", the due date one word per line). Keyed to the LIST
   width, not the screen: phones, and small tablets where the list sits beside the summary (~380px at
   768px). Below 520px of list the number box keeps the number on one line in a smaller font, and the
   right column becomes its own full-width row under the details: items badge on the left, amount and
   chevron on the right with the transaction # under the price. Wider lists keep the three-column head. */
#pawn-loans-container .fc-pawn-col {
  container: pawn-list / inline-size;
}
@container pawn-list (max-width: 520px) {
  #pawn-loans-container .fc-pawn-ticket-head {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: var(--space-2);
  }
  #pawn-loans-container .fc-pawn-thumb-number {
    max-width: none;
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: 0.75rem;
    line-height: 16px;
  }
  /* Bottom row, as the wide head's right column reads: items badge on the left; amount + chevron on
     the right with "Transaction #…" right under the price. */
  #pawn-loans-container .fc-pawn-ticket-side {
    flex-basis: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "badge amount"
      ".     trans";
    align-items: center;
    gap: var(--space-1) var(--space-2);
  }
  #pawn-loans-container .fc-pawn-itembadge {
    grid-area: badge;
    justify-self: start;
  }
  #pawn-loans-container .fc-pawn-amount-row {
    grid-area: amount;
    justify-self: end;
  }
  #pawn-loans-container .fc-pawn-transnum {
    grid-area: trans;
    justify-self: end;
    text-align: right;
  }
}

.fc-pawn-amount {
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-body-md-lh);
  letter-spacing: 0.2px;
  color: var(--color-text-primary);
  white-space: nowrap;
}
/* Chevron rotates (v3.0.1 motion, 0.2s ease); 20px like v3.1's Block accordion head glyph. */
.fc-pawn-chev {
  display: inline-block;
  font-size: 20px;
  line-height: 24px;
  color: var(--color-text-primary);
  transition: transform 0.2s ease;
}
.fc-pawn-chev--open {
  transform: rotate(180deg);
}

/* ── Chips and badges (Momento pills) ── */
.fc-pawn-chip,
.fc-pawn-itembadge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 24px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: 24px;
  white-space: nowrap;
}
.fc-pawn-itembadge {
  background: var(--color-brand-primary);
  color: var(--color-surface-default);
}
.fc-pawn-chip--overdue,
.fc-pawn-chip--urgent {
  color: var(--fc-loan-urgent);
  background: color-mix(in srgb, var(--fc-loan-urgent) 10%, transparent);
}
.fc-pawn-chip--soon {
  color: var(--fc-loan-soon);
  background: color-mix(in srgb, var(--fc-loan-soon) 10%, transparent);
}
.fc-pawn-chip--ok,
.fc-pawn-chip--paid {
  color: var(--fc-loan-ok);
  background: color-mix(in srgb, var(--fc-loan-ok) 10%, transparent);
}
.fc-pawn-chip--active {
  color: var(--color-brand-primary);
  background: color-mix(in srgb, var(--color-brand-primary) 8%, transparent);
}
/* Detail status pill: 0 16px, 32px tall. */
.fc-pawn-chip--pill {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 var(--space-2);
  line-height: 32px;
}
/* A chip in a ticket head ("Due {date}" / "Vence el {date}", "Paid") wraps inside its text column
   instead of spilling over the item badge and amount: at 360px every Spanish due chip is wider than
   that column, and at 375px the longer ones are. Each line keeps the 24px line box (one line 24px, two
   48px), the way v3.1's .product-card-tag wraps inside its box. Radius 12px, half that line box: a
   one-line chip is the same pill as before, and a wrapped one is a rounded rectangle, not a stretched
   capsule. */
.fc-pawn-ticket-main .fc-pawn-chip {
  max-width: 100%;
  white-space: normal;
  border-radius: var(--radius-md);
}

/* ── Ticket body: always rendered, the panel animates 0fr → 1fr (v3.0.1 and v3.1 .fc-item-acc-panel,
   0.3s cubic-bezier(.25,.46,.45,.94)). A collapsed panel turns visibility:hidden once its close
   transition ends, so its link leaves the Tab order (grid 0fr only clips). ── */
.fc-pawn-acc {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0s linear 0.3s;
}
.fc-pawn-acc--open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition:
    grid-template-rows 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0s linear 0s;
}
.fc-pawn-acc-inner {
  min-height: 0;
  overflow: hidden;
}
.fc-pawn-ticket-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-2);
}
.fc-pawn-divider {
  height: 1px;
  background: var(--color-border);
}
.fc-pawn-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.fc-pawn-item + .fc-pawn-item {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2);
}
.fc-pawn-item-img {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-default);
  object-fit: contain;
}
/* An item's own picture: cropped to fill with no frame, as v3.0.1's photo rows (Kelly's image #2). */
.fc-pawn-item-img.fc-pawn-item-img--photo {
  border: none;
  object-fit: cover;
}
.fc-pawn-item-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}
.fc-pawn-item-name {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* "View Loan Details": a real link in v3.1's link-button look (.fc-item-storelink). */
.fc-pawn-details {
  align-self: center;
}

/* Firearm note (copy kept as v3.0.1). */
.fc-pawn-firearm {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-muted);
}
.fc-pawn-firearm i {
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: var(--text-body-md-lh);
  color: var(--color-brand-primary);
}

/* ── Summary: sticky right column from 768px ──
   Pins below the back bar: header + 41px bar + 16px gap (the .fc-item-gallery rule), riding the
   header's 0.42s curve. 768–1024: when the small header hides, the sticky top drops by
   --native-header-h on the back bar's 0.3s curve. A sticky offset only moves it while pinned; the
   translateY used before kept shifting it after the pin let go at the end of the scroll (Kelly,
   2026-10-07). 340px wide as in v3.0.1 (a component width, not spacing; not a multiple of 8, flagged). */
.fc-pawn-summary {
  flex-shrink: 0;
  width: 340px;
  position: sticky;
  top: calc(var(--fc-header-h, 0px) + 57px);
  transition:
    top 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* No max-width cap: fc-native-header-hidden exists only in the native shell, so this cannot reach
   desktop web at any width, and a tablet in landscape needs the same compensation portrait does.
   + --fc-safe-top: while the header is hidden the back bar (.fc-item-bar, shared with Item Detail)
   is the topmost element and pays the status-bar inset itself, so its box grows by that much.
   Subtracting only --native-header-h moved the summary up by the header's full height while the bar
   below it got taller, leaving it behind the bar — measured at -16px on Item Detail. */
@media (min-width: 768px) {
  .fc-pawn-summary {
    transition: top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  /* 25% of the row instead of the fixed 340px, on tablets only. The constant is 26.6% of web's
     1280px content column but 43.1% of an iPad's 788px in portrait, which squeezed the loan cards
     and truncated the ticket item names. Covers the list AND Pawn Loan Detail, which share this
     aside. Web and phones keep 340px. */
  html.fc-native-shell .fc-pawn-summary { width: 25%; }
  html.fc-native-header-hidden .fc-pawn-summary {
    top: calc(var(--fc-header-h, 0px) + 57px - var(--native-header-h, 0px) + var(--fc-safe-top, 0px));
  }
}
@media (min-width: 768px) and (orientation: portrait) {
  /* PORTRAIT 35%, landscape 25%. A single percentage cannot serve both: 25% of an iPad's 788px
     portrait row is 197px, too narrow for an item name beside its price, while 25% of the 1046px
     landscape row is a comfortable 261px. Keyed on `orientation`, not a width breakpoint, so a
     Split View window gets the share that matches its own aspect rather than the device's. */
  html.fc-native-shell .fc-pawn-summary { width: 35%; }
}
.fc-pawn-summary-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--color-surface-default);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.fc-pawn-summary-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-body-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-primary);
}
/* Rows in 24px line boxes. The divider above Remaining Balance is drawn on that row (8px above the
   line from the gap, 8px below it from the padding), so it adds no odd pixel to the drawer height. */
.fc-pawn-summary-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.fc-pawn-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-muted);
}
.fc-pawn-summary-val {
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
}
.fc-pawn-paid {
  font-weight: var(--fw-bold);
  color: var(--fc-loan-ok);
}
.fc-pawn-summary-row--total {
  padding-top: var(--space-1);
  box-shadow: inset 0 1px 0 var(--color-border);
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
}

/* List summary: "PAY MINIMUM(S) DUE · {n} loans due · {amount}" (locked variant, no buttons). */
.fc-pawn-nextpay {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.fc-pawn-nextpay-label {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-body-md-lh);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
}
/* Centred in equal 24px line boxes (v3.0.1 aligned on the baseline, which could grow the row by a pixel
   or two and break the drawer's 8px-multiple height). */
.fc-pawn-nextpay-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}
.fc-pawn-nextpay-count {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-muted);
}
.fc-pawn-nextpay-amt {
  font-family: var(--font-heading);
  font-size: var(--text-heading-sm-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-heading-sm-lh);
  color: var(--color-text-primary);
  white-space: nowrap;
}

/* ── Loan Detail (fc-pld-*) ─────────────────────────────────────────────────────────────────── */
.fc-pld-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.fc-pld-hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
}
/* 26px as in v3.0.1 (flagged against Item Detail's 28px h1). */
.fc-pld-ticket-no {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-heading-lg-size);
  font-weight: var(--fw-xbold);
  line-height: var(--text-heading-lg-lh);
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
}
.fc-pld-opened {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}

/* Stats: 4 across from 1025px, 2×2 below. With v3.1's money format ("$1,000.00") four tiles no longer
   fit next to the 340px summary at 768–1024 (v3.0.1 showed 4 there). */
.fc-pld-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (min-width: 1025px) {
  .fc-pld-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  /* A finished loan has no Amount Paid stat (Kelly, 2026-10-07), so its three stats share the row. */
  .fc-pld-stats.fc-pld-stats--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.fc-pld-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
}
.fc-pld-stat-label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}
.fc-pld-stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-heading-xsm-size);
  font-weight: var(--fw-xbold);
  line-height: var(--text-heading-xsm-lh);
  letter-spacing: -0.3px;
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}
.fc-pld-stat-value--primary {
  color: var(--color-brand-primary);
}
.fc-pld-stat-value--success {
  color: var(--fc-loan-ok);
}
.fc-pld-stat-value--urgent {
  color: var(--fc-loan-urgent);
}

/* Items on Loan card + table (min 700px, scrolls sideways in its own box). */
.fc-pld-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--color-surface-default);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.fc-pld-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.fc-pld-card-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-body-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-primary);
}
/* Detail page loaders: the page's own and the AuthGate / LinkedAccountGate ones that show before it,
   all centred on the screen as on Item Details. Scoped to this page so other gated pages keep theirs. */
.fc-pld-loading,
#pawn-loan-detail-container .fc-authgate-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.fc-pld-table-scroll {
  overflow-x: auto;
  margin: 0 calc(-1 * var(--space-2));
  padding: 0 var(--space-2);
}
.fc-pld-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}
.fc-pld-th {
  padding: var(--space-1) var(--space-2) var(--space-1) 0;
  text-align: left;
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-body-md-lh);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}
.fc-pld-th:last-child,
.fc-pld-td:last-child {
  padding-right: 0;
}
/* Sort control: a real <button> inside the <th> (aria-sort stays on the th), UA chrome stripped so it
   reads as the header text. Press from the catch-all; focus is v3.1's button outline. */
.fc-pld-sortbtn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}
.fc-pld-sorticon {
  display: inline-block;
  font-size: 14px;
  color: var(--color-text-muted);
  opacity: 0.4;
  transition: transform 0.2s;
}
.fc-pld-sorticon--active {
  color: var(--color-brand-primary);
  opacity: 1;
}
.fc-pld-sorticon--asc {
  transform: rotate(180deg);
}

.fc-pld-tr {
  border-bottom: 1px solid var(--color-border);
}
.fc-pld-td {
  padding: var(--space-2) var(--space-2) var(--space-2) 0;
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-primary);
}
.fc-pld-td--bold {
  font-weight: var(--fw-bold);
}
.fc-pld-td--muted {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.fc-pld-loc {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.fc-pld-loc i {
  font-size: 0.75rem;
}
.fc-pld-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.fc-pld-item-img {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-default);
  object-fit: contain;
}
/* A real photo fills its box with no frame, like the list's .fc-pawn-item-img--photo. */
.fc-pld-item-img.fc-pld-item-img--photo {
  border: none;
  object-fit: cover;
}
.fc-pld-item-name {
  max-width: 200px;
  font-weight: var(--fw-bold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Phones (≤767): the items table fits the screen (no sideways scroll), so the price is always
   visible, and every heading and row stays on one line. The price column shrinks to its content
   (width 1%, no wrapping: the "Item Price" heading and "$1,234.56"); the name column takes the rest
   (width 100%; max-width 0 keeps the long name from widening the table), and the item name and its
   heading truncate with an ellipsis. */
@media (max-width: 767px) {
  .fc-pld-table {
    min-width: 0;
  }
  .fc-pld-th:first-child,
  .fc-pld-td:first-child {
    width: 100%;
    max-width: 0;
  }
  .fc-pld-th:last-child,
  .fc-pld-td:last-child {
    width: 1%;
    white-space: nowrap;
    text-align: right;
  }
  .fc-pld-th:first-child .fc-pld-sortbtn {
    max-width: 100%;
  }
  /* Caps the price heading so a long translation ("Precio del producto") truncates instead of
     squeezing out the item names; "Item Price" fits whole. */
  .fc-pld-th:last-child .fc-pld-sortbtn {
    max-width: 150px;
  }
  .fc-pld-sortbtn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fc-pld-sortbtn i {
    flex-shrink: 0;
  }
  .fc-pld-item {
    min-width: 0;
  }
  .fc-pld-item-name {
    max-width: none;
    min-width: 0;
  }
}

/* ── Phones (≤767): the summary becomes a bottom drawer ────────────────────────────────────────
   In-flow position:sticky; bottom:0, NOT position:fixed: a fixed element inside
   #main-scroll-container repaints every frame on the iOS WebView (MainLayout.razor), and on web it
   would cover the site footer. As a sticky last item it stays on the bottom edge while the content
   scrolls under it, then settles after the content, before the footer. It takes its own height in
   the flow, so it is the page's clearance: nothing to reserve, and nothing at all when it isn't
   rendered (History, or nothing due). The page column grows (flex above), so on a short page the
   drawer still starts at the bottom of the screen.
   App: the scroller already pads for the tab bar, so bottom:0 sits on it; the drawer drops its own
   bottom inset there. Web: the inset clears the home indicator.
   Card padding 16 and an 8px gap between its parts (spec §5, phone summary drawer card).
   Heights, all on the 8px scale (relied on by the Go to Top lift, see --fc-bottom-drawer-h):
     list   16 + 24 + 8 + 24 + 16 = 88px (one part, so the gap adds nothing)
     detail 16 + 24 + 8 + 96 + 16 = 160px; + 8 + 48 = 216px with the firearm note on two lines.
   The note's line count depends on width and language (Helvetica Neue 14px, measured in Chrome): two
   lines below 436px in English and at 358-647px in Spanish (216px); one line from 436px in English or
   648px in Spanish (192px); three lines in Spanish below 358px (240px). Published: 216px, and 240px
   below 358px in both languages (html carries no per-language hook, and lifting Go to Top 24px too
   high in English there is harmless; publishing too little would let the drawer cover it). */
@media (max-width: 767px) {
  .fc-pawn-inner:has(> .fc-pawn-grid > .fc-pawn-summary) {
    padding-bottom: 0;
  }

  .fc-pawn-summary {
    position: sticky;
    top: auto;
    bottom: 0;
    z-index: 1;
    width: auto;
    margin: 0 calc(-1 * var(--space-2));
    transform: none;
  }
  .fc-pawn-summary-card {
    gap: var(--space-1);
    border-radius: 0;
    box-shadow: inset 0 1px 0 var(--color-border);
    padding: var(--space-2) var(--space-2)
      calc(var(--space-2) + var(--fc-bottom-inset));
  }
  .page.has-bottomnav .fc-pawn-summary-card {
    padding-bottom: var(--space-2);
  }

  /* Drawer title in the small-caps label style (v3.0.1). */
  .fc-pawn-summary-title {
    font-family: var(--font-body);
    font-size: var(--text-label-md-size);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-muted);
  }

  /* Drawer height for a Go to Top lift on web. The FAB is styled only in app.css (Kelly's one-place
     rule); this only publishes how tall the drawer is. Ignored until app.css reads it. */
  html:has(.fc-pawn-summary--list) {
    --fc-bottom-drawer-h: 88px;
  }
  html:has(.fc-pawn-summary--detail) {
    --fc-bottom-drawer-h: 160px;
  }
  html:has(.fc-pawn-summary--detail .fc-pawn-firearm) {
    --fc-bottom-drawer-h: 216px;
  }
}
@media (max-width: 357px) {
  html:has(.fc-pawn-summary--detail .fc-pawn-firearm) {
    --fc-bottom-drawer-h: 240px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .fc-pawn-history,
  .fc-pawn-ticket,
  .fc-pawn-acc,
  .fc-pawn-acc--open,
  .fc-pawn-chev,
  .fc-pawn-summary,
  .fc-pld-sorticon {
    transition: none;
  }
}
