/* Portal styles — modal + (later) sidebar + dashboard.
   Reuses :root tokens defined in site.css. Pure CSS, no Tailwind build step.
   Loaded on every page so the login modal can open from the marketing header. */

/* Global defensive rule: any explicit author `display: flex/inline-flex/...`
   overrides the UA's `[hidden] { display: none }`, so elements with the HTML
   hidden attribute kept rendering. Force `hidden` to always win across the
   portal — saves us from per-class `.foo[hidden] { display: none !important }`
   workarounds (`.btn-pay`, `.dash-badge`, `.dash-section`, `.inv-svc-link`,
   `.inv-service-chip`, etc.). */
[hidden] { display: none !important; }


/* ===========================================================================
   §1 — Login modal (centered, backdrop-blur, dark)
   =========================================================================== */

/* Backdrop = dimmed area behind the modal. Same frosted-glass feel as the
   marketing nav top bar — light blur so you can still read the page through
   it as context, just darkened. */
.pm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 12, 0.62);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  z-index: 200;
}
.pm-backdrop[data-open] {
  opacity: 1;
  visibility: visible;
}

.pm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 10px));
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: rgba(19, 19, 21, 0.92);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 38px 36px 30px;
  z-index: 201;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity .25s ease,
    visibility .25s ease,
    transform .42s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.pm-modal[data-open] {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.pm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.pm-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(232, 228, 220, 0.04);
}

.pm-brand {
  height: 22px;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  opacity: 0.85;
}
.pm-brand img {
  height: 22px;
  width: auto;
  display: block;
}

.pm-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 6px;
  font-variation-settings: "opsz" 80, "SOFT" 50;
}

.pm-sub {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 300;
  margin: 0 0 22px;
}

.pm-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pm-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.pm-link {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding: 2px 0;
  cursor: pointer;
  transition: color .2s ease, opacity .2s ease;
}
.pm-link:hover {
  color: var(--glint-warm);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pm-submit {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
  padding: 14px 22px;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

.pm-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
}

/* Three always-present views — JS toggles data-view on .pm-views to swap. */
.pm-view { display: none; }
.pm-views[data-view="login"] .pm-view[data-view="login"],
.pm-views[data-view="reset"] .pm-view[data-view="reset"],
.pm-views[data-view="sent"]  .pm-view[data-view="sent"]  { display: block; }

/* Centered back-link row under reset/sent forms */
.pm-back-row {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
}
.pm-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}
.pm-back svg { opacity: 0.7; transition: transform .2s ease, opacity .2s ease; }
.pm-back:hover svg { transform: translateX(-3px); opacity: 1; }
.pm-back:hover { color: var(--text); }

.pm-sent-email {
  color: var(--text);
  font-weight: 400;
  font-style: italic;
  font-family: 'Fraunces', Georgia, serif;
}

/* Lock background scroll while a portal modal is open */
body.pm-open {
  overflow: hidden;
}

/* ===========================================================================
   §3 — Portal layout shell (sidebar + topbar + main)
   Mobile-first: hamburger sheet on phones, then icon rail at 768px+,
   then full-width sidebar with labels at 1024px+.
   =========================================================================== */

/* Marketing site.css locks body to 100vh / overflow:hidden for the single-screen
   hero. Portal pages need normal page scroll — opt out via body class. */
body.is-portal {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}
/* Lock scroll only while mobile sidebar is sliding in over content */
body.pa-side-open { overflow: hidden; }

.pa-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;           /* mobile: single column */
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "top"
    "main";
  position: relative;
  z-index: 1;                            /* sit above vignette + noise */
}

/* ----- Sidebar ------------------------------------------------------ */

.pa-side {
  position: fixed;
  inset: 0 auto 0 0;                     /* mobile: slide-in from left */
  width: min(280px, 84vw);
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: rgba(11, 11, 12, 0.96);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  backdrop-filter: blur(20px) saturate(120%);
  border-right: 1px solid var(--line-strong);
  transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.2,.7,.2,1);
  padding: 18px 14px 18px;
}
.pa-side[data-open] { transform: translateX(0); }

.pa-side-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 12, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  z-index: 89;
}
.pa-side-backdrop[data-open] { opacity: 1; visibility: visible; }

.pa-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.pa-brand { display: inline-flex; align-items: center; line-height: 0; opacity: 0.92; }
.pa-brand-full { height: 26px; width: auto; display: block; }
.pa-brand-mark { height: 22px; width: auto; display: none; }

.pa-side-close {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.pa-side-close:hover { color: var(--text); border-color: var(--line-strong); background: rgba(232,228,220,0.04); }

.pa-side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.pa-side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
  position: relative;
}
.pa-side-item:hover:not(.is-disabled):not(.is-active) {
  color: var(--text);
  background: rgba(232, 228, 220, 0.04);
}
.pa-side-item.is-active {
  color: var(--text);
  background: rgba(200, 169, 130, 0.07);
  border-color: rgba(200, 169, 130, 0.18);
}
.pa-side-item.is-active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.pa-side-item.is-disabled {
  color: var(--text-faint);
  cursor: not-allowed;
}
.pa-side-item.is-disabled .pa-ico { opacity: 0.55; }

.pa-ico { width: 18px; height: 18px; flex-shrink: 0; }
.pa-side-label { flex: 1 1 auto; }

/* Sidebar count badge — populated by /portal/api/profile on every page.
   Small outlined pill: text + thin border share one tonal color, fill is
   the same color at 10% opacity. Hidden when count is 0; invoices badge
   stays hidden in the happy "all paid" state. */
.pa-side-badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid currentColor;
  /* line-height = inner height (height − 2×border) so the digit sits dead-
     centre vertically. Geist Mono at 10px reads cleanly at this size. */
  font: 600 10px/16px 'Geist Mono', monospace;
  letter-spacing: 0;
  text-align: center;
  background: transparent;
}
.pa-side-badge-success {
  color: var(--color-success, #7C9876);
  background: rgba(124, 152, 118, 0.10);
}
.pa-side-badge-danger {
  color: var(--color-danger, #D85A55);
  background: rgba(216, 90, 85, 0.10);
}
.pa-side-badge[hidden] { display: none; }

.pa-soon {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.pa-side-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}
.pa-signout .pa-ico { transition: transform .2s ease; }
.pa-signout:hover .pa-ico { transform: translateX(2px); }

/* ----- Topbar ------------------------------------------------------- */

.pa-top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 12, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  position: sticky;
  top: 0;
  z-index: 60;
}

.pa-hamburger {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.pa-hamburger:hover { color: var(--text); border-color: var(--line-strong); }
.pa-hamburger svg { width: 18px; height: 18px; }

.pa-top-title {
  flex: 1 1 auto;
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.012em;
  color: var(--text);
  font-variation-settings: "opsz" 60, "SOFT" 50;
}

.pa-top-right { display: flex; align-items: center; gap: 12px; }

/* Avatar + dropdown */
.pa-user { position: relative; }
.pa-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.pa-user-trigger:hover { color: var(--text); border-color: var(--line-strong); background: rgba(232,228,220,0.03); }

.pa-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(200, 169, 130, 0.2);  /* bronze @ 20% — quiet disc */
  color: var(--accent);                   /* full-strength bronze icon strokes */
}
.pa-avatar svg { width: 22px; height: 22px; color: inherit; }
.pa-chev { width: 10px; height: 10px; opacity: 0.7; }

.pa-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: rgba(19,19,21,0.96);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 70;
}
.pa-user[data-open] .pa-user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pa-user-meta {
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.pa-user-name { font-size: 14px; color: var(--text); font-weight: 400; }
.pa-user-email {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-top: 4px;
  word-break: break-all;
}

.pa-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  border-radius: 2px;
  transition: color .2s ease, background .2s ease;
}
.pa-user-item:hover { color: var(--text); background: rgba(232,228,220,0.04); }
.pa-user-item svg { width: 14px; height: 14px; opacity: 0.7; }
.pa-user-item:hover svg { opacity: 1; }

/* ----- Main content area ------------------------------------------ */

.pa-main {
  grid-area: main;
  /* Marketing main{} flexes + centers + caps min-height = 100vh — undo all of it */
  display: block;
  text-align: left;
  min-height: 0;
  align-items: initial;
  justify-content: initial;
  padding: 24px 18px 60px;
  width: auto;
  /* width cap moved to inner content wrappers (.dash, .inv-detail) so the
     §6 surface (noise + bg color) spans the full grid cell edge-to-edge */
}
.pa-main > .dash,
.pa-main > .inv-detail {
  max-width: 1200px;
  margin: 0 auto;
}

/* ----- Tablet (≥768px): icon-rail sidebar always visible ---------- */
@media (min-width: 768px) {
  .pa-shell {
    grid-template-columns: 72px 1fr;
    grid-template-areas:
      "side top"
      "side main";
  }
  .pa-side {
    grid-area: side;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transform: none !important;
    width: 72px;
    border-right: 1px solid var(--line);
    padding: 18px 8px;
  }
  .pa-side-close { display: none; }
  .pa-side-head { justify-content: center; padding: 4px 0 22px; }
  .pa-brand-full { display: none; }
  .pa-brand-mark { display: block; }
  .pa-side-item {
    flex-direction: column;
    gap: 6px;
    padding: 12px 8px;
    text-align: center;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: 'Geist Mono', monospace;
  }
  .pa-side-item.is-active::before {
    left: -8px;
    top: 10px;
    bottom: 10px;
  }
  .pa-soon { display: none; }                    /* no room on a 72px rail */
  .pa-hamburger { display: none; }
  .pa-side-backdrop { display: none; }
  .pa-main { padding: 32px 28px 60px; }
}

/* ----- Desktop (≥1024px): full sidebar with labels ---------------- */
@media (min-width: 1024px) {
  .pa-shell {
    grid-template-columns: 244px 1fr;
  }
  .pa-side {
    width: 244px;
    padding: 22px 14px;
  }
  .pa-side-head { justify-content: flex-start; padding: 4px 8px 22px; }
  .pa-brand-full { display: block; }
  .pa-brand-mark { display: none; }
  .pa-side-item {
    flex-direction: row;
    gap: 12px;
    padding: 11px 12px;
    text-align: left;
    font-size: 13.5px;
    letter-spacing: 0;
    text-transform: none;
    font-family: inherit;
  }
  .pa-side-item.is-active::before {
    left: -14px;
    top: 8px;
    bottom: 8px;
  }
  .pa-soon { display: inline-block; }
  .pa-top { padding: 0 32px; }
  .pa-main { padding: 36px 40px 60px; }
}

/* ===========================================================================
   §4 — Dashboard content (greeting + stat cards + renewals + invoices)
   =========================================================================== */

.dash { display: flex; flex-direction: column; gap: 28px; }

/* ----- Greeting band ---------------------------------------------- */
.dash-hero { padding: 6px 0 6px; }
/* Page hero treatment — every portal page title (Profile / Services /
   Invoices etc.) inherits the same Fraunces italic display + bronze
   trailing dot as the marketing homepage and the dashboard welcome
   name. One typography rule, one shared identity. */
.dash-greet {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 0.92;
  letter-spacing: -0.028em;
  color: var(--text);
  margin: 0 0 8px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  text-wrap: balance;
}
.dash-greet::after {
  content: ".";
  color: var(--accent);
  font-style: normal;
  margin-left: 0.02em;
}
/* Legacy hook — leave a way for any `<em>` inside a greet to break out
   of italic + bronze-up (kept for backwards compatibility with old
   templates that did `Welcome back, <em>Name</em>`). */
.dash-greet em { font-style: normal; color: var(--accent); font-weight: 500; }

/* ----- Welcome strip: small mono eyebrow + Fraunces name + mono meta ---
   Aligned to the existing portal hero pattern (.svc-hero-eyebrow +
   .svc-hero-name) so the dashboard's welcome surface reads as part of
   the same family as the Service/Profile/Invoice headers.

   Three lines, all in the established portal typography:
     - WELCOME BACK,           ← .dash-eyebrow (mono whisper, 9.5px)
     - Khodour Fouani.         ← .dash-name    (Fraunces serif, 30px)
     - CLIENT SINCE: MAY 19    ← .dash-meta    (mono whisper, 9.5px) */
.dash-eyebrow {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-variation-settings: "opsz" 72, "SOFT" 50;
}
/* Hero treatment — matches the marketing homepage "Premium." headline
   verbatim: Fraunces italic display, cream body color, bronze trailing
   dot via ::after. Same font / variation settings / clamp size / dot
   placement as `.headline .word` in site.css. */
.dash-name {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  /* Smaller than the marketing hero (which is a full-screen showpiece) —
     this welcome name sits inside a card next to the loyalty box, so a
     mid-large display size works better than the 108px homepage range. */
  font-size: clamp(34px, 4vw, 46px);
  line-height: 0.92;
  letter-spacing: -0.028em;
  color: var(--text);
  margin: 0 0 12px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  text-wrap: balance;
}
.dash-name::after {
  content: ".";
  color: var(--accent);
  font-style: normal;
  margin-left: 0.02em;
}
/* Page-brief style — the small editorial whisper that sits under every
   page title (Profile / Services / Invoices use this verbatim, so any
   tweak here must keep them all consistent). For the dashboard's tiny
   "Client since" line use `.dash-stamp` instead. */
.dash-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
  line-height: 1.5;
}

/* Dashboard-only micro-whisper — the personal data stamp under the
   welcome name (e.g. "CLIENT SINCE: MAY 19, 2024"). Smaller + tighter
   than `.dash-meta` because it's a single fact line, not a sentence. */
.dash-stamp {
  font-family: 'Geist Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
  line-height: 1.4;
}

/* Two-column welcome row: greeting on the left, loyalty card on the right.
   Wraps under the greeting on narrow screens so the card never crushes the
   heading. */
.dash-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.dash-hero-left { flex: 1 1 280px; min-width: 0; }

/* ----- Loyalty card (sepia, dashed outline) ----------------------------
   Stand-alone mini box on the right of the welcome row. Dashed border
   matches the portal's dashed-row hairline convention (tables + info
   rows use the same language).

   --tier-ink is set inline by renderDashboard() from loyalty.color
   (admin-picked hex from /settings/loyalty in the dashboard). The fallback
   value on this rule kicks in only if the API somehow omits color or the
   JS hasn't run yet. --tier-line stays a constant lighter neutral. */
.dash-loyalty {
  --tier-ink:  #7E775F;
  --tier-line: #C9C2AA;

  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "eyebrow  pct"
    "chip     pct"
    "caption  caption";
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;

  /* Smaller, more refined card. Picks up the same surface formula as
     `.dash-section` (subtle dark fill + faint solid hairline + backdrop
     blur) so it reads as part of the portal's card system, not a
     freehand sketch. */
  min-width: 200px;
  max-width: 240px;
  padding: 12px 14px 13px;
  background: rgba(19, 19, 21, 0.42);
  border: 1px solid var(--line);
  border-radius: 4px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  align-self: flex-start;
}
.dash-loyalty[hidden] { display: none; }

/* On phones the dash-hero-row stacks (welcome left, loyalty right →
   welcome top, loyalty below). The loyalty card stretches to the full
   row width — same pattern as `.pf-support-id` in profile so the
   "Account level" card reads as a primary stat band, not a narrow chip.
   `align-self: stretch` is required because the base rule sets
   `align-self: flex-start` which would otherwise pin the card to its
   intrinsic (narrow) width. */
@media (max-width: 640px) {
  .dash-hero-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  /* `.dash-hero-left { flex: 1 1 280px }` is sized for the desktop ROW
     layout — once the row flips to a column, that 280px becomes a vertical
     basis that pads the welcome block to ~280px tall regardless of content,
     opening a big empty gap above the loyalty card. Reset to auto sizing. */
  .dash-hero-left { flex: 0 0 auto; }
  .dash-loyalty {
    max-width: none;
    min-width: 0;
    width: 100%;
    align-self: stretch;
  }
}

.dash-loyalty-eyebrow {
  grid-area: eyebrow;
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1;
}

/* Big percent number, top-right. Matches the greeting's Fraunces serif so
   the card belongs to the page typographically. */
.dash-loyalty-pct {
  grid-area: pct;
  align-self: center;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--tier-ink);
  font-variation-settings: "opsz" 80, "SOFT" 50;
  font-feature-settings: "tnum";  /* tabular numbers so values don't shimmy as they update */
}

/* Outline chip — transparent fill, tier-colored border + text. */
.loyalty-chip-outline {
  grid-area: chip;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 3px 11px;
  border: 1px solid var(--tier-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--tier-ink);
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  font-weight: 600;
  line-height: 1.6;
  text-transform: uppercase;
}

.dash-loyalty-caption {
  grid-area: caption;
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1.3;
}

/* Two-panel container — stacks on mobile/tablet, side-by-side at desktop */
.dash-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 1100px) {
  .dash-panels { grid-template-columns: 1fr 1fr; }
}

/* ----- Sectioned panels (active services + recent invoices) ------ */
.dash-section {
  background: rgba(19,19,21,0.42);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 4px 6px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  /* Bounded height so cards don't extend forever. Grid stretches both
     siblings to share the same row height, so they stay equal. */
  display: flex;
  flex-direction: column;
  max-height: 460px;
}
.dash-section-head {
  flex-shrink: 0;
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-section-title {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
  font-weight: 500;
}
.dash-section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 2px;
  transition: color .2s ease, transform .2s ease;
}
.dash-section-link:hover {
  color: var(--accent);
}
.dash-section-link:hover svg { transform: translateX(2px); }
.dash-section-link svg { transition: transform .2s ease; opacity: 0.7; }
.dash-section-link:hover svg { opacity: 1; }
.dash-section-link[aria-disabled="true"] {
  color: var(--text-faint);
  pointer-events: none;
  opacity: 0.6;
}

/* Scrollable body region inside the card */
.dash-section-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  /* Subtle scrollbar styling (WebKit) */
  scrollbar-width: thin;
  scrollbar-color: rgba(232,228,220,0.12) transparent;
}
.dash-section-body::-webkit-scrollbar { width: 8px; }
.dash-section-body::-webkit-scrollbar-track { background: transparent; }
.dash-section-body::-webkit-scrollbar-thumb {
  background: rgba(232,228,220,0.10);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.dash-section-body::-webkit-scrollbar-thumb:hover {
  background: rgba(232,228,220,0.20);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ----- Renewals list ---------------------------------------------- */
.dash-renewals { list-style: none; margin: 0; padding: 0; }
.dash-renewal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px dashed var(--line);   /* portal-wide row separator rule */
}
.dash-renewal:last-child { border-bottom: 0; }
.dash-renewal-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dash-renewal-name {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-renewal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.dash-renewal-when {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: right;
  flex-shrink: 0;
}
.dash-renewal-when strong { color: var(--text); font-weight: 400; }
.pa-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ----- Invoices table (native <table> — columns auto-share width) - */
.inv {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;                       /* predictable column widths */
}
/* Fixed column proportions for the 4-column layout:
     1. Invoice  — number + dim date below
     2. Service  — clickable link (or em-dash) to /portal/services/{id}
     3. Status   — single badge
     4. Amount   — right-aligned; on unpaid rows also holds the Pay button
                   to the right of the amount, so this column gets extra room */
.inv thead th:nth-child(1),
.inv tbody td:nth-child(1) { width: 22%; }
.inv thead th:nth-child(2),
.inv tbody td:nth-child(2) { width: 26%; }
.inv thead th:nth-child(3),
.inv tbody td:nth-child(3) { width: 18%; }
.inv thead th:nth-child(4),
.inv tbody td:nth-child(4) { width: 34%; text-align: right; }
.inv th,
.inv td {
  text-align: left;
  padding: 14px 12px;
  vertical-align: middle;
}
/* Portal tables use ONLY dashed row borders — never solid, never column dividers,
   never outer frames. Header gets a slightly stronger dash so it reads as a
   header-vs-body delimiter. */
.inv td {
  border-bottom: 1px dashed var(--line);
}
.inv thead th {
  border-bottom: 1px dashed var(--line-strong);
}
.inv tbody tr:last-child td { border-bottom: 0; }

.inv th {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 400;
}

.inv td.inv-num  { font-size: 14px; color: var(--text); }
.inv td.inv-date {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  white-space: nowrap;
}
.inv td.inv-amt {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}

/* Status pills */
.pa-pill-sm {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  align-self: flex-start;
  width: max-content;
}
/* Status pills driven by API's status_tone (warning / success / info / danger) */
.pa-pill-sm.is-warning {
  color: var(--accent);
  border-color: rgba(200, 169, 130, 0.45);
}
.pa-pill-sm.is-success {
  color: var(--text-faint);
  border-color: var(--line);
}
.pa-pill-sm.is-info {
  color: var(--text-dim);
  border-color: var(--line);
}
.pa-pill-sm.is-danger {
  color: #E8A87C;
  border-color: rgba(232, 168, 124, 0.45);
}

/* Phone (≤640px): collapse <table> into card-list. Each <tr> becomes a card,
   each <td> shows its label via data-label::before. Native table column-share
   still applies on tablet+ where the table renders normally. */
@media (max-width: 640px) {
  .inv,
  .inv thead,
  .inv tbody,
  .inv tr,
  .inv th,
  .inv td { display: block; width: 100%; }
  .inv thead { display: none; }            /* header columns make no sense in card mode */
  .inv tbody tr {
    padding: 12px 6px;
    border-bottom: 1px solid var(--line);
  }
  .inv tbody tr:last-child { border-bottom: 0; }
  .inv td {
    padding: 5px 12px;
    border: 0;
    display: flex;
    justify-content: space-between;
    gap: 14px;
  }
  .inv td::before {
    content: attr(data-label);
    font-family: 'Geist Mono', monospace;
    font-size: 9.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faint);
  }
}

/* Stat cards: 2-col earlier (no longer used in template, kept for any future card grid) */
@media (min-width: 480px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
}

/* Phone (≤540px): keep modal centered, just tighter padding + bigger tap targets.
   Width comes from the base min(420px, calc(100vw - 32px)), so it stays centered
   with 16px breathing space on each side. */
@media (max-width: 540px) {
  .pm-modal {
    padding: 30px 22px 22px;
  }
  .pm-title { font-size: 24px; }
  .pm-brand { margin-bottom: 18px; }
  .pm-sub { margin-bottom: 18px; }
  .pm-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
}


/* ===========================================================================
   AJAX framework — field errors, form messages, list states
   =========================================================================== */

.field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #E8A87C;
  letter-spacing: 0.01em;
}

.form-message {
  display: none;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.4;
}
.form-message:not(:empty) { display: block; }
.form-message.is-err {
  background: rgba(232, 168, 124, 0.07);
  border: 1px solid rgba(232, 168, 124, 0.32);
  color: #E8A87C;
}
.form-message.is-ok {
  background: rgba(200, 169, 130, 0.07);
  border: 1px solid rgba(200, 169, 130, 0.30);
  color: var(--accent);
}

/* Listing skeleton / empty / error states */
.ajax-skeleton {
  padding: 22px 18px;
  color: var(--text-faint);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.ajax-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}
.ajax-error {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-dim);
  font-size: 13px;
}
.ajax-error button {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 2px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.ajax-error button:hover {
  background: rgba(232, 228, 220, 0.04);
  border-color: rgba(232, 228, 220, 0.3);
}

/* Loading state: hide non-skeleton children, show skeleton placeholder */
.ajax-list[data-loading] > :not([data-skeleton]) { display: none; }
.ajax-list[data-loading] [data-skeleton] { display: block; }
.ajax-list:not([data-loading]) [data-skeleton] { display: none; }


/* ===========================================================================
   404 error page
   =========================================================================== */

.err-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 80px;
  position: relative;
  z-index: 10;
}
.err-card {
  max-width: 480px;
  text-align: center;
}
.err-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.err-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.022em;
  color: var(--text);
  margin: 0 0 14px;
  font-variation-settings: "opsz" 120, "SOFT" 50;
}
.err-sub {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 28px;
}
.err-actions {
  display: flex;
  justify-content: center;
}


/* ===========================================================================
   Sign-out — buttons wrapped in ajax-form, must look identical to the <a> they replaced
   =========================================================================== */
.pa-signout-form { margin: 0; padding: 0; }
.pa-side .pa-signout,
.pa-user-signout {
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 100%;
  font: inherit;
  text-align: left;
}


/* ===========================================================================
   Set-password landing page (/portal/set-password/{token})
   =========================================================================== */

.sp-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  position: relative;
  z-index: 10;
}
.sp-card {
  width: min(440px, 100%);
  background: rgba(19, 19, 21, 0.92);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 38px 36px 32px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.sp-card .pm-brand { margin-bottom: 22px; }
.sp-card .pm-sub { margin-bottom: 22px; }


/* ===========================================================================
   Phase C — Invoices list + detail pages
   =========================================================================== */

/* Filter button group (segmented control) */
.inv-filters {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px;
  margin-bottom: 18px;
}
.inv-filter {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 14px;
  color: var(--text-dim);
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: color .2s ease, background .2s ease;
}
.inv-filter:hover { color: var(--text); }
.inv-filter[aria-pressed="true"] {
  color: var(--text);
  background: rgba(232, 228, 220, 0.06);
}

/* Sortable column header */
.inv th[data-sort] { cursor: pointer; user-select: none; }
.inv th[data-sort]::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  margin-left: 6px;
  opacity: 0.4;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: opacity .15s ease, transform .15s ease;
}
.inv th[data-sort="asc"]::after  { transform: rotate(180deg); opacity: 1; }
.inv th[data-sort="desc"]::after { opacity: 1; }

/* Clickable row hover affordance */
.inv tbody tr[data-href] { cursor: pointer; transition: background .15s ease; }
.inv tbody tr[data-href]:hover { background: rgba(232, 228, 220, 0.03); }

/* Disabled button + tooltip */
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}
.btn[disabled]:hover {
  background: var(--text);
  border-color: var(--text);
}
.btn[disabled][data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 2px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  z-index: 30;
}

/* Detail page layout */
.inv-detail {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 900px;
}
.inv-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.inv-detail-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.inv-detail-number {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: var(--text);
  margin: 0 0 8px;
}
.inv-detail-actions {
  display: flex;
  gap: 10px;
}
.inv-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  padding: 18px;
  background: rgba(19, 19, 21, 0.42);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.inv-summary-cell .lbl {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.inv-summary-cell .val {
  font-size: 18px;
  color: var(--text);
  margin-top: 4px;
}
.inv-detail-items .dash-section-title { margin-bottom: 12px; }


/* ===========================================================================
   §6 — Warm dark surface for .pa-main with cream noise grain
   ===========================================================================
   Sidebar/topbar stay flat cool dark (#0B0B0C). The content container gets
   a mid-warm dark base + an SVG fractal-noise tile tinted toward the brand
   cream (#E8E4DC), giving it a paper/film character. The noise is set as
   a bg-image (not a pseudo-element) so it doesn't interact with the z-index
   stack of dashboard children. */

.pa-main {
  background-color: #070503;
  background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.91 0 0 0 0 0.89 0 0 0 0 0.86 0 0 0 0.32 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px 220px;
  box-shadow: inset 0 0 500px 220px rgba(0, 0, 0, 0.97);
}


/* ===========================================================================
   §7 — Dashboard lifespan chart (custom SVG, no chart library)
   ===========================================================================
   Spec: docs/superpowers/specs/2026-05-18-portal-dashboard-lifespan-chart-design.md
   Renders one row per active service. Each row: green dot at starts_on, a
   gradient bar (green → bronze → red) to next_bill_on, red dot at the end.
   A dashed TODAY line crosses all rows. Pure SVG built in dashboard_lifespan.js. */

.dash-lifespan { max-height: none; }

/* Dedicated list pages (services, invoices) own the whole viewport — the
   page itself scrolls, not the inner section. Cancels the dashboard's
   `.dash-section { max-height: 460px }` panel bound so long tables grow
   in natural document flow and the browser handles vertical scrolling. */
.dash-section-page { max-height: none; }
.dash-section-page .dash-section-body { overflow: visible; }
.dash-lifespan .dash-section-body {
  overflow: visible;
  padding: 6px 2px 2px;
}
.dash-lifespan-count {
  font-family: 'Geist Mono', monospace;
  color: var(--text-faint);
  font-weight: 400;
}
#lifespan-chart {
  width: 100%;
  min-height: 80px;
}

.lf-svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Service name (left column, right-aligned, cream) */
.lf-name {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  fill: #E8E4DC;
  transition: fill .15s ease;
}

/* Each row is wrapped in <a href="/portal/services/{id}"> so the whole row
   is clickable. Cursor + accent on hover telegraphs the click affordance;
   the underlying SVG behavior (middle-click → new tab, keyboard focus)
   comes for free. */
.lf-row { cursor: pointer; }
.lf-row:hover .lf-name,
.lf-row:focus-visible .lf-name {
  fill: var(--accent);
}
.lf-row:focus-visible {
  outline: 1px dashed rgba(200, 169, 130, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Per-bar start/renewal date labels */
.lf-date {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: rgba(232, 228, 220, 0.62);
}

/* TODAY label */
.lf-today-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  fill: #E8E4DC;
}

/* Bars + dots: fully visible by default (animations were unreliable across
   the SVG cascade — we can revisit with JS-driven motion if needed). */
.lf-bar { opacity: 1; }
.lf-dot { opacity: 1; }

/* Background calendar grid */
.lf-grid { /* color set inline; class is mostly for future tweaks */ }
.lf-grid-label {
  font-family: 'Geist Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  fill: rgba(232, 228, 220, 0.35);
}

/* TODAY line + label: simply visible. No animation. */
.lf-today-line  { opacity: 1; }
.lf-today-label { opacity: 1; }

/* ----- My services row title + urgency badge --------------------- */
.dash-renewal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dash-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}
.dash-badge-urgent {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-line);
}
/* Defensive: ensure browsers honor the `hidden` attribute on inline-flex children */
.dash-badge[hidden] { display: none !important; }


/* ===========================================================================
   §8 — Skeleton shimmer loaders (used during ajax-list / ajax-detail loads)
   ===========================================================================
   Universal placeholder block + width presets. Drop multiple .skel-bar
   elements inside an .ajax-skeleton wrapper to mimic the real row layout
   so the panel doesn't visibly resize when data arrives.

   Why a gradient here despite the "no portal gradients" rule: skeletons are
   transient loaders, not surfaces. The shimmer effect REQUIRES gradient. */

.skel-bar {
  display: inline-block;
  vertical-align: middle;
  height: 11px;
  width: 100px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(232, 228, 220, 0.05) 0%,
    rgba(232, 228, 220, 0.18) 50%,
    rgba(232, 228, 220, 0.05) 100%
  );
  background-size: 220% 100%;
  animation: skel-shimmer 1.5s linear infinite;
}
.skel-bar.skel-h-sm { height:  9px; }
.skel-bar.skel-h-md { height: 14px; }
.skel-bar.skel-h-lg { height: 18px; }

.skel-w-xs { width:  52px !important; }
.skel-w-sm { width:  82px !important; }
.skel-w-md { width: 124px !important; }
.skel-w-lg { width: 180px !important; }
.skel-w-xl { width: 240px !important; }

@keyframes skel-shimmer {
  0%   { background-position:  220% 0; }
  100% { background-position: -220% 0; }
}

/* Skeleton row that mimics .dash-renewal (My services panel). Renders as a
   flex layout matching the eventual rendered row, so the panel keeps its
   shape during load. */
.dash-renewal-skel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.dash-renewal-skel:last-child { border-bottom: 0; }
.dash-renewal-skel .skel-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.dash-renewal-skel .skel-row {
  display: flex;
  gap: 10px;
  align-items: center;
}


/* ===========================================================================
   §9 — Unpaid invoices panel
   ===========================================================================
   Top-of-dashboard list, hidden by default ([hidden] attribute). One row
   per unpaid invoice with an inline urgency badge and a Pay-now CTA. */

.dash-unpaid {
  /* Same .dash-section base; this just tightens vertical rhythm against
     the lifespan chart immediately below */
  margin-bottom: 4px;
}
.dash-unpaid-count {
  font-family: 'Geist Mono', monospace;
  color: var(--text-faint);
  font-weight: 400;
}
.dash-unpaid-list { list-style: none; margin: 0; padding: 0; }

.dash-unpaid-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px dashed var(--line);   /* portal-wide row separator rule */
  cursor: pointer;
  transition: background .15s ease;
}
.dash-unpaid-row:hover { background: rgba(232, 228, 220, 0.02); }
.dash-unpaid-row:last-child { border-bottom: 0; }

.dash-unpaid-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.dash-unpaid-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.dash-unpaid-num {
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  white-space: nowrap;
}
.dash-unpaid-amt {
  font-family: 'Geist Mono', monospace;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dash-unpaid-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Badge tones — reuses .dash-badge typography from §7 */
.dash-badge-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-line);
}
.dash-badge-neutral {
  background: rgba(232, 228, 220, 0.06);
  color: var(--text-dim);
  border: 1px solid rgba(232, 228, 220, 0.16);
}

/* Pay-now button — primary bronze pill, 30px tall, matches portal CTA rhythm */
.btn-pay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1A1413;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 2px;
  font-weight: 500;
  white-space: nowrap;
  transition: filter .15s ease, transform .15s ease;
}
.btn-pay:hover { filter: brightness(1.08); }
.btn-pay:active { transform: translateY(1px); }
/* Defensive: explicit `display: inline-flex` above overrides the HTML
   `hidden` attribute's `display: none`, so paid/cancelled rows kept
   showing Pay-now. Force `hidden` to win. */
.btn-pay[hidden] { display: none !important; }

/* Tail row for overflow ("+N more unpaid · See all →") */
.dash-unpaid-tail {
  list-style: none;
  padding: 12px 18px 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}
.dash-unpaid-tail a {
  color: var(--accent);
  text-decoration: none;
}
.dash-unpaid-tail a:hover { color: #D6BA94; }

/* Skeleton row matching the unpaid row shape */
.dash-unpaid-skel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.dash-unpaid-skel:last-child { border-bottom: 0; }
.dash-unpaid-skel .skel-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.dash-unpaid-skel .skel-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Mobile — stack badge below amount, full-width Pay button */
@media (max-width: 480px) {
  .dash-unpaid-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .dash-unpaid-meta { gap: 8px; }
  .btn-pay {
    justify-content: center;
    width: 100%;
  }
}


/* ===========================================================================
   §10 — Invoices pages refactor (list + detail)
   =========================================================================== */

/* ----- Success badge variant (rounds out §7 dash-badge tones) ---- */
.dash-badge-success {
  background: var(--color-success-soft);
  color: var(--color-success);
  border: 1px solid var(--color-success-line);
}

/* ----- "All caught up" empty state — Unpaid invoices panel -------
   Replaces the plain `.ajax-empty` line when there are no unpaid invoices.
   Lives inside a <td colspan> so the surrounding table chrome stays put;
   we just neutralize the cell padding and pillarbox a small centered card. */
.inv-allset-row td {
  padding: 38px 18px;
  text-align: center;
  border-bottom: 0;
}
.inv-allset {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 340px;
}
.inv-allset-icon {
  width: 38px;
  height: 38px;
  color: var(--color-success);
  margin-bottom: 4px;
}
.inv-allset-title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0;
  line-height: 1.3;
}
.inv-allset-sub {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ----- Breadcrumb (all portal pages except dashboard) ---------- */
.pa-crumbs {
  margin: 0 0 22px;
}
.pa-crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.pa-crumbs li {
  display: inline-flex;
  align-items: center;
  color: var(--text-faint);
}
.pa-crumbs li + li::before {
  content: '›';
  display: inline-block;
  margin: 0 12px;
  color: var(--text-faint);
  opacity: 0.55;
  font-size: 12px;
}
.pa-crumbs a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color .15s ease;
}
.pa-crumbs a:hover { color: var(--text); }
.pa-crumbs li[aria-current="page"] { color: var(--text); }

/* ----- List page: filter pills with counts ---------------------- */
.inv-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.inv-filter-count {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(232, 228, 220, 0.08);
  color: var(--text-dim);
  min-width: 18px;
  text-align: center;
}
.inv-filter[aria-pressed="true"] .inv-filter-count {
  background: rgba(232, 228, 220, 0.16);
  color: var(--text);
}
.inv-filter.has-urgent[data-filter="unpaid"] .inv-filter-count {
  background: rgba(216, 90, 85, 0.16);
  color: #D85A55;
}

/* ----- List page: invoice-number cell ---------------------------- */
/* Two-line layout:
     line 1 = invoice number (cream) + " · service name" (dim cream)
     line 2 = issued date (mono, faint)
   The service name sits right next to the invoice id so it reads as
   primary metadata, not a hidden hint. */
.inv-num-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}
.inv-num-main {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.25;
}
.inv-num-svc {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 400;
  white-space: nowrap;
}
.inv-num-date {
  margin-top: 5px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* ----- List page: status column (badge only — no inline Pay) --- */
.inv-status .dash-badge-status {
  /* Primary status indicator — sized bigger than the in-row "Expire soon"
     alert badges from §7 to earn visual weight. */
  display: inline-flex;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  padding: 5px 11px;
}

/* ----- List page: service column (clickable link) -------------- */
.inv-svc { overflow: hidden; }
.inv-svc-link {
  color: var(--text);
  font-size: 13.5px;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  padding-bottom: 1px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease;
}
.inv-svc-link:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary-line);
}
.inv-svc-empty {
  color: var(--text-faint);
  font-family: 'Geist Mono', monospace;
}

/* ----- List page: amount + Pay button cell (rightmost) -------- */
/* The Amount cell holds the dollar value, and on unpaid rows also a
   Pay-now button to the right of it. .inv-amt-wrap is a flex container
   pinned to the right edge so both elements anchor flush-right. */
.inv-amt-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.inv-amt-val {
  font-family: 'Geist Mono', monospace;
  font-size: 15.5px;
  letter-spacing: 0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}
.inv-amt-wrap .btn-pay {
  padding: 6px 14px;
  font-size: 10px;
  letter-spacing: 0.14em;
}

/* Tighten the gap between filter pills and the table. Beyond reducing the
   filter margin, we strip the .dash-section chrome (panel bg + border +
   padding) when it directly follows the filters — the table itself is
   visually rich enough; the panel wrap was making it feel boxed off.
   Same rule applies to the new .inv-tabs row that replaces those pills. */
.inv-filters { margin-bottom: 8px; }
.inv-filters + .dash-section,
.inv-tabs + .dash-section,
.inv-tabs-bar + .dash-section {
  background: transparent;
  border: 0;
  padding: 0;
  max-height: none;
  /* `.dash` is a flex column with gap:28px; pull the section up so the
     visual gap between filters and table is only ~10px, not ~36px. */
  margin-top: -20px;
}
.inv-filters + .dash-section .dash-section-body,
.inv-tabs + .dash-section .dash-section-body,
.inv-tabs-bar + .dash-section .dash-section-body {
  padding: 0;
  overflow: visible;
}

/* ===========================================================================
   §13 — Invoice list: real tabs + pagination
   ===========================================================================
   Refactored from the old aria-pressed pill group into a proper tab row with
   an underline-active treatment. Each tab is a real <a href> driving a
   server-side filter (`?status=`); the active tab is rendered by the server. */

/* Hero row: title left, unpaid counter chip on the right. The default
   .dash flex gap of 28px leaves a noticeably-too-large gap below the
   title; we collapse it via a negative pull on the tabs row. */
.inv-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
/* Title→brief gap must match the other portal pages — leave `.dash-greet`
   default margin alone here. (Was `margin: 0` for the old layout that had
   no brief beneath; the new layout uses `.dash-meta` directly under so
   the 8px gap from `.dash-greet` is what carries the system rhythm.) */

.inv-unpaid-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px;
  background: var(--color-danger-soft);
  border: 1px solid var(--color-danger-line);
  border-radius: 2px;
  text-decoration: none;
  font-family: 'Geist Mono', monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-danger);
  transition: filter .15s ease, transform .15s ease, background .15s ease, border-color .15s ease;
  flex-shrink: 0;
}
.inv-unpaid-chip[href]:hover  { filter: brightness(1.15); }
.inv-unpaid-chip[href]:active { transform: translateY(1px); }
.inv-unpaid-chip:not([href])  { cursor: default; }

.inv-unpaid-amount {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  letter-spacing: 0;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--color-danger);
  font-weight: 400;
}
.inv-unpaid-currency {
  font-size: 10px;
  color: var(--color-danger);
  margin-left: -2px;
}
.inv-unpaid-label {
  font-size: 10px;
  margin-left: 6px;
  opacity: 0.85;
}

/* Zero state — nothing owed. Drop the danger color; show neutral so the
   client isn't visually pestered when they're square. */
.inv-unpaid-chip.is-zero {
  background: rgba(232, 228, 220, 0.04);
  border-color: rgba(232, 228, 220, 0.14);
  color: var(--text-faint);
}
.inv-unpaid-chip.is-zero .inv-unpaid-amount,
.inv-unpaid-chip.is-zero .inv-unpaid-currency,
.inv-unpaid-chip.is-zero .inv-unpaid-label {
  color: var(--text-faint);
}

@media (max-width: 480px) {
  .inv-hero-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .inv-unpaid-chip { padding: 7px 11px; gap: 6px; }
  .inv-unpaid-amount { font-size: 18px; }
}

/* Tabs bar: visual shared between the invoices list (`.inv-*`) and the
   portal-generic tabs (`.pa-*`) used by other paged sections (e.g. profile).
   They share the look but diverge in side-effects: only `.inv-*` strips the
   chrome of the following `.dash-section` (see chrome-strip rule above) —
   the table inside invoices doesn't want the panel wrap, but a form card
   does. Keep them on separate hooks so each opts in to what it needs. */
.inv-tabs-bar,
.pa-tabs-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px dashed var(--line-strong);
  margin-bottom: 0;
  flex-wrap: wrap;
}

.inv-tabs,
.pa-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.inv-tab,
.pa-tab {
  position: relative;
  padding: 12px 18px;
  font-family: 'Geist Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  transition: color .15s ease;
}
.inv-tab:hover,
.pa-tab:hover { color: var(--text-dim); }
.inv-tab.is-active,
.pa-tab.is-active {
  color: var(--color-primary);
}
.inv-tab.is-active::after,
.pa-tab.is-active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--color-primary);
}

/* Profile-page chrome around the form card that follows the tabs.
   Unlike the invoices table, the form NEEDS the card wrap — but we still
   want comfortable breathing room from the dashed tab underline above. */
.pa-tabs-bar + .dash-section {
  margin-top: 18px;
}

/* ----- Date range filter (right side of tabs row) ----------------
   Native <input type="date"> styled to feel like the rest of the portal.
   Sits on a baseline-style flat surface; on hover/focus the input border
   warms up to the bronze accent. */
.inv-daterange {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 8px;        /* lifts the input off the dashed underline */
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.inv-daterange-label {
  color: var(--text-faint);
  cursor: pointer;
}
/* Custom portal datepicker — keeps the chip on the tabs row consistent
   across browsers (native <input type="date"> looked very different in
   Safari vs Chrome). Trigger styled like a button-chip; popover is a
   shadowed card anchored below. */
.dp { position: relative; display: inline-block; }
.dp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  background: rgba(232, 228, 220, 0.04);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-dim);
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  padding: 7px 10px;
  line-height: 1;
  cursor: pointer;
  min-height: 30px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.dp-trigger:hover,
.dp.dp-open .dp-trigger,
.dp-trigger:focus-visible {
  border-color: var(--color-primary-line);
  background: rgba(200, 169, 130, 0.06);
  color: var(--text);
  outline: none;
}
.dp.dp-has-value .dp-trigger { color: var(--text); }
.dp-trigger-label { line-height: 1; }
.dp-trigger-icon {
  width: 13px; height: 13px;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: color .15s ease;
}
.dp-trigger:hover .dp-trigger-icon,
.dp.dp-open .dp-trigger-icon { color: var(--color-primary); }

/* ----- Popover (calendar card) ---------------------------------- */
.dp-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;             /* anchor right edge to the trigger */
  z-index: 50;
  width: 280px;
  padding: 14px;
  background: rgba(14, 11, 9, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  font-family: 'Geist Mono', monospace;
  color: var(--text);
}

/* Head: month/year title + prev/next arrows */
.dp-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dp-title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--text);
}
.dp-nav {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-dim);
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.dp-nav:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-line);
  background: rgba(200, 169, 130, 0.06);
}
.dp-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Weekday row */
.dp-pop-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
}
.dp-pop-weekdays span { padding: 4px 0; }

/* Day grid */
.dp-pop-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-day {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--text-dim);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  padding: 6px 0;
  line-height: 1;
  cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.dp-day:hover:not(:disabled):not(.is-selected) {
  background: rgba(200, 169, 130, 0.08);
  color: var(--text);
}
.dp-day.is-out { color: var(--text-faint); opacity: 0.45; }
.dp-day.is-today:not(.is-selected) {
  border-color: var(--color-primary-line);
  color: var(--color-primary);
}
.dp-day.is-selected {
  background: var(--color-primary);
  color: #0E0B09;          /* near-black for contrast on bronze */
  border-color: var(--color-primary);
  font-weight: 500;
}
.dp-day.is-disabled,
.dp-day:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* Footer: Today + Clear */
.dp-pop-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.dp-foot-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-faint);
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 2px;
  cursor: pointer;
  transition: color .15s ease;
}
.dp-foot-btn:hover { color: var(--color-primary); }

@media (max-width: 560px) {
  /* Anchor to left on mobile so the popover doesn't get cropped at the right
     edge of the viewport when the trigger sits flush-left. */
  .dp-pop { right: auto; left: 0; }
}

.inv-daterange-sep {
  color: var(--text-faint);
  opacity: 0.6;
}
.inv-daterange-to {
  color: var(--text-dim);
}
.inv-daterange-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 2px;
  border: 1px dashed var(--line);
  border-radius: 50%;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
  transition: color .15s ease, border-color .15s ease;
}
.inv-daterange-clear:hover {
  color: var(--color-danger);
  border-color: var(--color-danger-line);
  border-style: solid;
}

@media (max-width: 560px) {
  .inv-tabs-bar,
  .pa-tabs-bar { align-items: stretch; }
  .inv-tabs,
  .pa-tabs { width: 100%; }
  .inv-tab,
  .pa-tab { padding: 10px 12px; font-size: 11.5px; flex: 1; text-align: center; }
  .inv-daterange {
    width: 100%;
    padding: 8px 0 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .inv-daterange-input { flex: 1; min-width: 130px; }
}

/* ----- Pagination row ------------------------------------------ */
.inv-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 4px 4px;
  flex-wrap: wrap;
}
.inv-pager-summary {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.inv-pager-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.inv-pager-btn,
.inv-pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.inv-pager-btn:hover,
.inv-pager-num:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
.inv-pager-num.is-current {
  color: #1A1413;
  background: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 500;
  cursor: default;
}
.inv-pager-btn.is-disabled {
  color: var(--text-faint);
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.inv-pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--text-faint);
  font-family: 'Geist Mono', monospace;
}

@media (max-width: 640px) {
  .inv-pager { justify-content: center; gap: 10px; }
  .inv-pager-summary { width: 100%; text-align: center; }
}

/* Sort indicator on active column */
.inv th[data-sort="asc"]::after,
.inv th[data-sort="desc"]::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.inv th[data-sort="asc"]::after  { border-bottom: 4px solid var(--accent); }
.inv th[data-sort="desc"]::after { border-top:    4px solid var(--accent); }

/* ----- List page mobile (≤640px): table → card stack ------------ */
@media (max-width: 640px) {
  table.inv.inv-card-ready,
  table.inv.inv-card-ready thead,
  table.inv.inv-card-ready tbody,
  table.inv.inv-card-ready tr,
  table.inv.inv-card-ready td {
    display: block;
  }
  table.inv.inv-card-ready thead { display: none; }
  /* Card mode owns its own layout — suppress the generic `.inv td::before`
     data-label that the base mobile rule adds, since the card's grid layout
     and cell content already establish visual hierarchy without keys. */
  table.inv.inv-card-ready td::before { content: none !important; }
  table.inv.inv-card-ready tr[data-href] {
    border: 1px dashed var(--line-strong);
    border-radius: 2px;
    padding: 14px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    background: rgba(0, 0, 0, 0.18);
  }
  table.inv.inv-card-ready tr[data-href] td {
    padding: 0;
    border: 0;
    width: auto !important;     /* override the fixed-layout widths */
  }
  /* Card layout (4 cells: Invoice / Service / Status / Amount):
       row 1 — Invoice number (left)            · Amount (right, big)
       row 2 — Service link (full width)
       row 3 — Status badge (full width) */
  table.inv.inv-card-ready tr[data-href] td.inv-num {
    grid-column: 1; grid-row: 1;
  }
  table.inv.inv-card-ready tr[data-href] td.inv-amt {
    grid-column: 2; grid-row: 1;
    text-align: right;
    font-size: 16px;
  }
  table.inv.inv-card-ready tr[data-href] td.inv-amt .inv-amt-wrap {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
  table.inv.inv-card-ready tr[data-href] td.inv-svc {
    grid-column: 1 / -1; grid-row: 2;
    font-size: 13px;
  }
  table.inv.inv-card-ready tr[data-href] td.inv-status {
    grid-column: 1 / -1; grid-row: 3;
    margin-top: 4px;
  }
}

/* ----- Detail page: refined invoice document layout ------------ */
.inv-detail-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
  margin: 0 auto;
  padding-top: 12px;
}
/* Hero — invoice number + inline status badge on the LEFT;
   action buttons (Pay / Download PDF) anchored TOP-RIGHT. */
.inv-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px dashed var(--line);
}
.inv-hero-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  font-weight: 400;
}
.inv-hero-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.inv-hero-number {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  line-height: 1;
}
.inv-hero-badge {
  font-size: 10px;
  padding: 5px 11px;
  letter-spacing: 0.14em;
}
.inv-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .inv-hero {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .inv-hero-actions > * { flex: 1; justify-content: center; text-align: center; }
}

/* ----- Detail page: service chip ------------------------------ */
.inv-service-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  align-self: flex-start;
  transition: color .15s ease, border-color .15s ease;
}
.inv-service-chip:hover {
  color: var(--accent);
  border-color: var(--line-strong);
}
.inv-service-chip strong {
  color: var(--text);
  font-weight: 500;
}

/* ----- Detail page: dates (single column, dashed row separators) ----- */
/* No Amounts column here — totals live at the bottom of the line items
   block instead, where they belong on a real invoice. Each date row has
   a dashed underline (per the portal-wide separator convention). */
.inv-dates { padding: 4px 0; }
.inv-dates-title {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 14px;
  font-weight: 400;
}
.inv-dates-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 28px;
  row-gap: 0;
}
.inv-dates-list dt,
.inv-dates-list dd {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.inv-dates-list dt {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.inv-dates-list dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.inv-dates-list dt:first-of-type,
.inv-dates-list dt:first-of-type + dd { padding-top: 0; }
.inv-dates-list dt:last-of-type,
.inv-dates-list dt:last-of-type + dd { border-bottom: 0; padding-bottom: 0; }

/* ----- Detail page: notes ------------------------------------- */
/* Quiet collapsible — no arrow caret, just a labeled summary line. */
.inv-notes {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.inv-notes summary {
  cursor: pointer;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  list-style: none;
  user-select: none;
}
.inv-notes summary::-webkit-details-marker { display: none; }
.inv-notes summary::after {
  content: 'Show';
  float: right;
  color: var(--text-faint);
}
.inv-notes[open] summary::after { content: 'Hide'; }
.inv-notes p {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ----- Detail page: line items styled as an invoice document -- */
.inv-items-title {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 16px;
  font-weight: 400;
}
.inv-items-table {
  width: 100%;
  border-collapse: collapse;
}
.inv-items-table thead th {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 400;
  padding: 0 0 12px;
  text-align: left;
  border-bottom: 1px dashed var(--line-strong);
}
.inv-items-table thead .inv-items-qty,
.inv-items-table thead .inv-items-price,
.inv-items-table thead .inv-items-total { text-align: right; }
.inv-items-table tbody td {
  padding: 16px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--line);
  vertical-align: top;
}
.inv-items-table tbody tr:last-child td { border-bottom: 0; }
.inv-items-table tbody td.inv-items-desc {
  color: var(--text);
  padding-right: 24px;
}
.inv-items-table tbody td.inv-items-qty,
.inv-items-table tbody td.inv-items-price,
.inv-items-table tbody td.inv-items-total {
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  color: var(--text);
  padding-left: 16px;
}
.inv-items-table tbody td.inv-items-qty { color: var(--text-dim); }

/* Totals block stacked at the bottom right of the items table */
.inv-items-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}
.inv-items-totals-row {
  display: grid;
  grid-template-columns: auto 140px;
  gap: 28px;
  align-items: baseline;
  font-family: 'Geist Mono', monospace;
}
.inv-items-totals-row span:first-child {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 10px;
  text-align: right;
  color: var(--text-dim);
}
.inv-items-totals-row span:last-child {
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}
.inv-items-totals-grand {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.inv-items-totals-grand span:first-child { color: var(--text); font-size: 11px; }
.inv-items-totals-grand span:last-child {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 18px;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .inv-items-table thead { display: none; }
  .inv-items-table tbody tr {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  .inv-items-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    border: 0;
  }
  .inv-items-table tbody td.inv-items-desc { padding-right: 0; }
  .inv-items-table tbody td.inv-items-qty,
  .inv-items-table tbody td.inv-items-price,
  .inv-items-table tbody td.inv-items-total { padding-left: 0; }
  .inv-items-table tbody td::before {
    content: attr(data-label);
    color: var(--text-faint);
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
  }
  .inv-items-totals-row { grid-template-columns: auto 100px; gap: 18px; }
}


/* ===========================================================================
   §11 — Profile page (account details + change password)
   ===========================================================================
   Two stacked .pf-card sections, each a .dash-section with a form inside.
   The default .dash-section has `max-height: 460px` + `overflow-y: auto`
   (built for the renewals list); on a form that traps the Save button
   inside an inner scroll on small viewports. Disable both: cards expand
   to fit content, page scrolls naturally. */

.dash-section.pf-card {
  max-height: none;
  display: block;
}
.pf-card .dash-section-body {
  overflow: visible;
}

.pf-body { padding: 14px 18px 6px; }

/* ----- Profile hero: title left + support-ID chip top-right -------- */
.pf-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.pf-hero-id { flex: 1 1 auto; min-width: 0; }

.pf-support-id {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  /* Right padding is wider than left so the absolutely-positioned copy
     icon (14px square at right:8) gets its own gutter without crashing
     into the support-ID number. */
  padding: 10px 32px 10px 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  position: relative;
  font: inherit;
  color: inherit;
}
.pf-support-id:hover {
  border-color: var(--color-primary-line);
  background: rgba(200, 169, 130, 0.04);
}
.pf-support-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.pf-support-value {
  font-family: 'Geist Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.pf-support-hash {
  color: var(--text-dim);
  margin-right: 1px;
}
.pf-support-copy {
  position: absolute;
  top: 8px; right: 8px;
  width: 14px; height: 14px;
  color: var(--text-faint);
  opacity: 0.55;
  transition: opacity .15s ease;
}
.pf-support-id:hover .pf-support-copy { opacity: 1; }

/* "Copied" feedback pulse */
.pf-support-id::after {
  content: 'Copied';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 152, 118, 0.16);
  color: var(--color-success);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.pf-support-id.is-copied::after { opacity: 1; }

@media (max-width: 480px) {
  .pf-hero { flex-direction: column; align-items: stretch; }
  .pf-support-id { align-items: flex-start; }
}

.pf-form { display: flex; flex-direction: column; gap: 18px; }

.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.pf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pf-field-full { grid-column: 1 / -1; }

.pf-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.pf-field input {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: border-color .15s ease, background .15s ease;
}
.pf-field input:focus {
  outline: none;
  border-color: var(--color-primary-line);
  background: rgba(0, 0, 0, 0.45);
}
.pf-field input.pf-input-readonly,
.pf-field input[readonly] {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-dim);
  cursor: not-allowed;
}
.pf-hint {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-top: 2px;
}

.pf-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
  padding: 14px 0 4px;
}
.pf-feedback {
  flex: 1 1 auto;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  min-height: 16px;
}
.pf-feedback.is-ok  { color: var(--color-success); }
.pf-feedback.is-err { color: var(--color-danger); }

@media (max-width: 640px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .pf-actions .btn-pay { width: 100%; justify-content: center; }
}


/* ===========================================================================
   §12 — Services pages (list + detail)
   ===========================================================================
   Mostly reuses the invoice list table primitives (.inv, .inv-card-ready,
   .dash-badge-*) — section adds 5-column widths, the description hint
   under each name, and the service-detail hero + custom-fields card. */

/* ----- List page: 5-column table ------------------------------- */
.svc-table.inv { table-layout: fixed; }
.svc-table.inv thead th:nth-child(1),
.svc-table.inv tbody td:nth-child(1) { width: 32%; }
.svc-table.inv thead th:nth-child(2),
.svc-table.inv tbody td:nth-child(2) { width: 14%; }
.svc-table.inv thead th:nth-child(3),
.svc-table.inv tbody td:nth-child(3) { width: 14%; }
.svc-table.inv thead th:nth-child(4),
.svc-table.inv tbody td:nth-child(4) { width: 20%; }
.svc-table.inv thead th:nth-child(5),
.svc-table.inv tbody td:nth-child(5) { width: 20%; text-align: right; }

.svc-name-main {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.25;
}
.svc-name-desc {
  margin-top: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-type-main {
  font-size: 12.5px;
  color: var(--text);
  text-transform: capitalize;
}
.svc-type-period {
  margin-top: 3px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.svc-renew-date {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--text);
}
.svc-renew-human {
  display: block;
  margin-top: 3px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.svc-amt .svc-amt-val {
  font-family: 'Geist Mono', monospace;
  font-size: 15.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Card mode on mobile — reuses .inv-card-ready rules; just remap cells.
   `min-width: 0` is required on every cell: grid items default to
   min-content sizing, so .svc-name-desc's nowrap+ellipsis pattern was
   forcing the name cell to expand to the full description width and
   blow past the card edge on phones. */
@media (max-width: 640px) {
  table.svc-table.inv-card-ready tr[data-href] {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name    amt"
      "type    type"
      "renew   renew"
      "status  status";
  }
  table.svc-table.inv-card-ready tr[data-href] td.svc-name   { grid-area: name;   min-width: 0; }
  table.svc-table.inv-card-ready tr[data-href] td.svc-amt    { grid-area: amt;    text-align: right; min-width: 0; }
  table.svc-table.inv-card-ready tr[data-href] td.svc-type   { grid-area: type;   min-width: 0; }
  table.svc-table.inv-card-ready tr[data-href] td.svc-renew  { grid-area: renew;  min-width: 0; }
  table.svc-table.inv-card-ready tr[data-href] td.svc-status { grid-area: status; margin-top: 4px; min-width: 0; }
}

/* ----- Detail page: hero (matches inv-hero rhythm) ------------- */
.svc-detail-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
  margin: 0 auto;
  padding-top: 12px;
}
.svc-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px dashed var(--line);
}
.svc-hero-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.svc-hero-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.svc-hero-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
  font-variation-settings: "opsz" 80, "SOFT" 50;
  line-height: 1;
}
.svc-hero-badge {
  font-size: 10px;
  padding: 5px 11px;
  letter-spacing: 0.14em;
}
.svc-hero-renew { text-align: right; }
.svc-hero-renew-date {
  font-family: 'Geist Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.svc-hero-renew-human {
  margin-top: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

@media (max-width: 640px) {
  .svc-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .svc-hero-renew { text-align: left; }
}

/* ----- Detail page: overview + custom-fields cards ------------- */
.svc-card { max-height: none; display: block; }
.svc-card .dash-section-body { overflow: visible; }

.svc-desc {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

/* Dates strip — sits ABOVE the overview card, full-width. Three columns:
   Created left-aligned, Started center-aligned, Next renewal right-aligned.
   No surrounding chrome — the cells let their own padding + the dashed
   border on the card below provide visual separation. */
.svc-dates {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  padding: 4px 4px 18px;
}
.svc-date {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.svc-date-left   { text-align: left;   align-items: flex-start; }
.svc-date-center { text-align: center; align-items: center; }
.svc-date-right  { text-align: right;  align-items: flex-end; }

.svc-date-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.svc-date-value {
  font-family: 'Geist Mono', monospace;
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .svc-dates { grid-template-columns: 1fr; gap: 14px; }
  .svc-date-left,
  .svc-date-center,
  .svc-date-right { text-align: left; align-items: flex-start; }
}

/* Overview card — proper key/value table with dashed row separators. */
.svc-overview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.svc-overview-table td {
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
  vertical-align: middle;
}
.svc-overview-table tr:last-child td { border-bottom: 0; }
.svc-overview-table td.svc-ov-key {
  width: 38%;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
}
.svc-overview-table td.svc-ov-val {
  font-size: 14px;
  color: var(--text);
  text-align: right;
  text-transform: capitalize;          /* `recurring` / `annual` → Recurring / Annual */
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .svc-overview-table td.svc-ov-key { width: 45%; font-size: 10px; }
  .svc-overview-table td.svc-ov-val { font-size: 13px; }
}
