/* ==========================================================================
   Stingray Bookkeeping client login, PASS 3: the premium client look as shared pieces.
   Made by PC 1, Oct 16 2026 (foundation for the pass-3 client pages). How to use every piece, with
   examples: PASS3-PC1-FOUNDATION.md. Every piece on one page: tools/pass3-pc1/components.html.

   LOAD ORDER (in <head>), as every pass-3 client page has it today:
     fonts.css, portal.css, client-pass3.css, the page's own css (then charts-pass3.css / customize-pass3.css).
   This file never changes portal.css: it loads after it and wins where it has to; a page's own css loads
   after this file and wins over it (INTEGRATION-CONTRACT.md 1.4 says client-pass3.css last; the pages were
   built and measured with this order, and the order does not change the look tokens below).
   JOINING STEP (Oct 17 2026): this file starts with the verbatim Look A token block of owner-aurora.css and
   holds no colour of its own; the --p3-* values of every look moved to portal.css.

   OPT IN:  <body class="p3" data-page="...">  and  <main id="main" class="page framed p3-page">
     body.p3     the header, the menu and the phone bar take the pass-3 dress (gold for "you are here")
     framed      keeps every card framed on a phone in the two engraved looks, as in the approved
                 mockups (without it portal.css turns engraved panels into one edge-to-edge sheet)
   Every class of this file starts with p3-, so pages that do not load it are not touched.

   THE FOUR LOOKS STAY. portal.js still sets data-theme (aurora, nightsky, engraved-dark, engraved-cream);
   every piece here reads the look's own names (--ink, --soft, --quiet, --rule, --line, --panel-*) plus
   the pass-3 names below, which each look fills in. Cards are portal.css panels (class="panel p3-card"),
   so the frosted glass of Northern lights, the flat Night sky, the gold frame of Engraved night and the
   cream paper of Engraved cream all still work, with navy words on cream by themselves.
   What is the SAME in every look (the approved pass-3 mockups): a dark teal main button with white
   words, gold for lines, dots, chips and "you are here", an elegant serif for big headings and big
   figures, dark words on bright chips.

   Contents
     1  Pass-3 names per look          9  Split bar (labels outside the bar)
     2  Page and columns              10  Quote card (gold left edge)
     3  Top bar, logo, Menu           11  Rows with hairlines, rows with a thin bar
     4  Phone tab bar                 12  Status pills
     5  Back to home                  13  Buttons
     6  Titles                        14  Two-way switch
     7  Photo banner, photo           15  4-dot tracker
     8  Card, figure trio             16  Menu sheet, small pieces, printing
   ========================================================================== */


/* COPY of owner-aurora.css PART 2 lines 328-356 (Look A tokens). Keep byte-identical; the joint check diffs it. */
:is(html[data-theme="aurora"], html:not([data-theme])) {
  /* glass panels: a little deeper and more frosted than the client pages, with a faint aurora edge */
  --panel-bg: linear-gradient(180deg, rgba(14, 30, 45, .66), rgba(8, 20, 33, .72));
  --panel-bg-plain: linear-gradient(180deg, rgba(14, 30, 45, .95), rgba(8, 20, 33, .96));
  --panel-line: rgba(176, 222, 232, .22);
  --panel-radius: 18px;
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 30px 64px -30px rgba(0, 0, 0, .85), 0 0 46px -26px rgba(64, 224, 190, .32);
  --panel-filter: blur(14px) saturate(1.25);
  --box-bg: rgba(5, 15, 26, .42);

  /* main buttons: deep aurora teal with white words (picture A). Both ends of the colour pass 4.5 to 1. */
  --btn1-bg: linear-gradient(180deg, #178079 0%, #11706b 55%, #0c5f5b 100%);
  --btn1-ink: #ffffff;
  --btn1-line: rgba(150, 236, 224, .55);
  --btn1-icon: #ffffff;
  --btn1-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 22px -10px rgba(0, 0, 0, .7), 0 0 22px -10px rgba(64, 224, 190, .45);
  --w-btn1: 600;

  /* second buttons: dark glass with a gold line (Fix it, Ask the client) */
  --btn2-bg: linear-gradient(180deg, rgba(20, 36, 50, .82), rgba(10, 24, 37, .86));
  --btn2-ink: #f7f2e8;
  --btn2-line: #d6ad66;
  --btn2-icon: #f0c577;
  --btn2-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  --btn2-bw: 1.5px;
  --w-btn2: 500;

  --focus: #a6ede5;
}


/* ==========================================================================
   1  PASS-3 NAMES PER LOOK
   The values of every look live in portal.css ("PASS-3 CLIENT NAMES PER LOOK"). In Look A (Northern lights,
   the default) the pass-3 names point at Look A's own names, so the client pages and the owner screen are
   one product: the same glass, the same teal main button, the same gold. Joining step, Oct 17 2026.
   ========================================================================== */

:is(html[data-theme="aurora"], html:not([data-theme])) {
  --p3-gold: var(--btn2-line);
  --p3-gold-ink: var(--fig);
  --p3-teal: var(--btn1-bg);
  --p3-main-line: var(--btn1-line);
  --p3-main-ink: var(--btn1-ink);
  --p3-main-shadow: var(--btn1-shadow);
  --p3-line-bg: var(--box-bg);
  --p3-bar-track: var(--rule);
  --p3-bar-on: var(--accent);
  --p3-pill-gold-bg: var(--btn2-line);
  --p3-pill-gold-line: var(--btn2-line);
  --p3-pill-done-bg: var(--on);
  --p3-pill-done-line: var(--on);
  --p3-pill-have-bg: var(--ink);
  --p3-pill-have-line: var(--ink);
  --p3-photo-ink: var(--ink);
}

/* THE WORDS OF LOOK A (Northern lights, the default): an elegant serif only for the big headings and the big
   figures (.p3-title, .p3-h2, .p3-hello, the figure trio, and the pieces that name var(--serif) themselves), a
   clean sans for labels, rows, pills, buttons, the back link, the menu and the phone tab bar, as the approved
   M2 and R2 pictures show (design review must-fix, Oct 17; first carried by reports.css and month.css alone).
   Engraved cream keeps its serif all through (his pick); Night sky and Engraved night already use the sans. */
html[data-theme="aurora"] body.p3,
html:not([data-theme]) body.p3 {
  --font-body: var(--sans);
  --font-ui: var(--sans);
}

html[data-theme="aurora"] body.p3 .bar a,
html:not([data-theme]) body.p3 .bar a {
  font-family: var(--sans);
}

/* ==========================================================================
   2  PAGE AND COLUMNS
   A centered column (1120 wide at most), or two columns from 1024 wide. Never a stretched phone.
   ========================================================================== */

body.p3 {
  --page-max: 1120px;
}

.p3-page {
  padding-bottom: 64px;
}

/* a reading column in the middle (760 wide) */
.p3-page.p3-narrow,
.p3-narrow {
  width: 100%;
  max-width: calc(760px + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
}

/* two columns on a computer: the main one a little wider. One column under 1024 wide. */
.p3-cols {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}

.p3-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}

@media (min-width: 1024px) {
  .p3-cols {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
  }

  .p3-cols.even {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}


/* ==========================================================================
   3  TOP BAR: the real logo mark, the company name, the menu, "Your look", "Menu"
   <header class="top p3-top"><div class="top-in">
     <a class="brand" href="home.html"><span class="p3-logo"><img src="logo-mark-white.png" alt=""></span><span class="brand-name">Birchline Plumbing</span></a>
     <nav class="menu" aria-label="Menu"> four links with data-nav </nav>
     <div class="top-tools">
       <button type="button" class="top-btn" data-open="look">Your look</button>
       <button type="button" class="top-btn p3-menu-btn" data-open="menu" aria-haspopup="dialog"><i data-icon="menu"></i>Menu</button>
     </div>
   </div></header>
   ========================================================================== */

/* the firm's real mark (logo-mark-white.png) in a gold ring on navy: it reads on every look */
.p3-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--p3-gold);
  border-radius: 50%;
  background: var(--p3-deep);
}

.p3-logo img {
  width: 80%;
  height: auto;
}

.p3-menu-btn .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  color: var(--p3-gold-ink);
}

/* the page you are on, in gold */
body.p3 .menu a[aria-current="page"] {
  color: var(--p3-bar-on);
}

body.p3 .menu a[aria-current="page"]::after {
  background: var(--p3-gold);
}

/* a sub-page ("Your month" lives under Home, portal.js sets aria-current="true"): the same gold mark */
body.p3 .menu a[aria-current="true"] {
  color: var(--p3-bar-on);
  font-weight: var(--w-menu-on);
}

body.p3 .menu a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--p3-gold);
}

@media (max-width: 1099px) {
  .p3-logo {
    width: 3.125rem;
    height: 3.125rem;
  }
}

@media (max-width: 899px) {
  .p3-logo {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* A small phone (360 wide): "Your look" and "Menu" stay on the brand's row in every look, also in the serif
   of Engraved cream (home review, Oct 17: at 360x740 they dropped to a second header row, 121px). The two
   buttons sit a little closer (neither one signs out), each still 48px tall with 18px words. */
@media (max-width: 419px) {
  body.p3 .top-tools {
    gap: 4px;
  }

  body.p3 .top-btn {
    padding: 0 3px;
  }

  body.p3 .brand {
    gap: 8px;
  }
}


/* ==========================================================================
   4  PHONE TAB BAR: Home, Reports, Send papers, Ask us. The page you are on is gold.
   The same <nav class="bar"> as KIT.md (it shows up to 899 wide; on a computer the menu in the top bar
   takes its place). "Your month" belongs to Home: <body class="p3" data-page="month" data-tab="home">.
   ========================================================================== */

body.p3 .bar a[aria-current="page"] {
  color: var(--p3-bar-on);
}

body.p3 .bar a[aria-current="page"]::before {
  background: var(--p3-gold);
}

@media (max-width: 899px) {
  body.p3 .bar a[aria-current="true"] {
    color: var(--p3-bar-on);
    font-weight: 700;
  }

  body.p3 .bar a[aria-current="true"]::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 24%;
    right: 24%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--p3-gold);
  }
}


/* ==========================================================================
   5  BACK TO HOME
   <a class="p3-back" href="home.html"><i data-icon="back"></i>Back to home</a>
   It sits straight on the art, so it carries its own soft dark ground.
   ========================================================================== */

.p3-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 48px;
  padding: 6px 16px 6px 12px;
  border-radius: 10px;
  background: var(--p3-chip-ground);
  color: var(--ink);
  font: var(--w-ui) var(--text)/1.2 var(--font-ui);
  text-decoration: none;
}

.p3-back .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  color: var(--p3-gold-ink);
}

.p3-back:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}


/* ==========================================================================
   6  TITLES
   .p3-title   the big serif line of an inner page ("Send us your papers.", "August 2026"). It may sit
               on the art: it brings its own soft darkening, like .greeting.
   .p3-title-row  a title with a pill beside it ("August 2026  Checked"); wraps on a small phone.
   .p3-h2      the serif heading of a card. .p3-sub a calm line under a heading.
   ========================================================================== */

.p3-title {
  position: relative;
  z-index: 0;
  width: fit-content;
  max-width: 100%;
  color: var(--ink);
  font: var(--w-greet) clamp(2.25rem, 4.2vw, 3.5rem)/1.1 var(--serif);
  letter-spacing: -.012em;
  text-shadow: var(--p3-title-shadow);
}

.p3-title::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -26px calc(-1 * var(--gutter)) -22px calc(-1 * var(--gutter));
  background: var(--greet-plate, none);
  pointer-events: none;
}

.p3-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.p3-h2 {
  color: var(--ink);
  font: var(--w-head) 1.75rem/1.2 var(--serif);
  letter-spacing: -.006em;
}

.p3-sub {
  color: var(--soft);
  font-size: var(--text-quiet);
}

@media (max-width: 699px) {
  .p3-title {
    font-size: clamp(2.125rem, 9.4vw, 2.5rem);
  }

  .p3-title::before {
    inset: -18px -16px -16px -16px;
  }

  .p3-h2 {
    font-size: 1.5625rem;
  }
}


/* ==========================================================================
   7  PHOTO BANNER AND PHOTO. Photos are decoration: alt="".
   Banner with words on it (home):
     <section class="p3-banner bleed">
       <img class="p3-banner-img" src="art/client/home-van.jpg" alt="">
       <div class="p3-banner-text"><h1 class="p3-hello"><span>Hello, Dana.</span> <span class="p3-hello-2">2 things need you.</span></h1></div>
     </section>
   A plain photo (papers, report):  <img class="p3-photo" src="art/client/papers-receipt.jpg" alt="">
   The dark fall-off at the bottom keeps the words above 4.5 to 1 on any part of the photo.
   ========================================================================== */

.p3-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--p3-card-line);
  border-radius: var(--p3-radius);
  background: var(--p3-deep);
}

.p3-banner-img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--p3-focus, 50% 40%);
}

.p3-banner::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--p3-banner-fade);
  pointer-events: none;
}

.p3-banner-text {
  position: relative;
  width: 100%;
  padding: 26px 32px 26px;
  color: var(--p3-photo-ink);
  text-shadow: var(--p3-photo-shadow);
}

/* the greeting on a banner: a big serif first line, a calmer second line */
.p3-hello {
  color: var(--p3-photo-ink);
  font: var(--w-greet) clamp(2.5rem, 4.6vw, 3.75rem)/1.06 var(--serif);
  letter-spacing: -.012em;
}

.p3-hello > span {
  display: inline-block;
}

.p3-hello-2 {
  display: block !important;
  margin-top: 6px;
  font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.2 var(--font-body);
  letter-spacing: 0;
}

.p3-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: var(--p3-focus, 50% 50%);
  border: 1px solid var(--p3-card-line);
  border-radius: var(--p3-radius);
}

@media (min-width: 900px) {
  .p3-banner {
    min-height: 380px;
  }

  .p3-photo {
    aspect-ratio: 21 / 9;
  }

  /* in a side column a photo stays a calm 3 by 2 */
  .p3-col .p3-photo {
    aspect-ratio: 3 / 2;
  }
}

@media (max-width: 699px) {
  /* bleed: from edge to edge of the phone, right under the top bar, as in the home mockup */
  .p3-banner.bleed {
    min-height: 360px;
    margin: -18px calc(-1 * var(--gutter)) 0;
    border: 0;
    border-radius: 0;
  }

  /* a page that forgot "framed" in an engraved look has no gutter on a phone: the banner then needs no pull */
  [data-theme^="engraved"] .page:not(.framed) .p3-banner.bleed {
    margin: 0;
  }

  .p3-banner::after {
    background: var(--p3-banner-fade-phone);
  }

  .p3-banner-text {
    padding: 20px var(--gutter) 22px;
  }

  .p3-hello {
    font-size: clamp(2.375rem, 11vw, 2.75rem);
  }

  .p3-hello-2 {
    font-size: 1.5rem;
  }
}


/* ==========================================================================
   8  CARD AND FIGURE TRIO
   <section class="panel p3-card"> ... </section>     a card: the look's own panel, pass-3 frame
     .p3-card.bare   the same ground with no frame line (figures that sit "on the page" in a mockup)
     .p3-card.glow   a gold frame with a soft glow: the ONE card that needs the client ("Waiting on you")
   The figure trio (came in / went out / kept, kept in gold):
     <div class="p3-figs">
       <div class="p3-fig"><b class="p3-fig-n amt">$24,180</b><span class="p3-fig-l">came in</span></div>
       <div class="p3-fig"><b class="p3-fig-n amt">$17,642</b><span class="p3-fig-l">went out</span></div>
       <div class="p3-fig kept"><b class="p3-fig-n amt">$6,538</b><span class="p3-fig-l">is what you kept</span></div>
     </div>
     .p3-figs.row   three columns side by side from 900 wide (figure on top, label under)
     .p3-figs.tall  the label ABOVE each figure: one under the other on a phone, three side by side from 900 wide
                    (the report page)
   One big figure alone ("Cash in the bank"): <b class="p3-fig-n solo amt">$18,406</b>
   ========================================================================== */

.panel.p3-card,
.p3-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-color: var(--p3-card-line);
  border-radius: var(--p3-radius);
}

.p3-card.bare {
  border-color: transparent;
  box-shadow: none;
}

.p3-card.glow {
  border-color: var(--p3-gold);
  box-shadow: var(--p3-glow), var(--panel-shadow, none);
}

/* a hairline between two parts of one card ("What was this charge?" over "A receipt is missing") */
.p3-split-line {
  height: 0;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.p3-figs {
  display: grid;
  gap: 4px;
}

.p3-fig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 16px;
  min-width: 0;
}

.p3-fig-n {
  color: var(--ink);
  font: var(--w-fig, 660) 2.75rem/1.12 var(--serif);
  letter-spacing: -.012em;
  white-space: nowrap;
}

.p3-fig.kept .p3-fig-n,
.p3-fig-n.kept {
  color: var(--p3-gold-ink);
}

.p3-fig-l {
  color: var(--soft);
  font-size: var(--text);
  line-height: 1.3;
}

.p3-fig-n.solo {
  font-size: 3.25rem;
}

.p3-figs.tall {
  gap: 14px;
}

.p3-figs.tall .p3-fig {
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0;
}

.p3-figs.tall .p3-fig-n {
  font-size: 3.25rem;
  line-height: 1.08;
}

@media (min-width: 900px) {
  .p3-figs.row,
  .p3-figs.tall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .p3-figs.row .p3-fig {
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 699px) {
  .p3-fig-n {
    font-size: clamp(2.125rem, 9.6vw, 2.5rem);
  }

  .p3-fig-n.solo,
  .p3-figs.tall .p3-fig-n {
    font-size: clamp(2.5rem, 12vw, 2.875rem);
  }
}


/* ==========================================================================
   9  SPLIT BAR: what went out and what is left, with the words OUTSIDE the bar (never white words on teal)
   <div class="p3-split">
     <div class="p3-split-bar" role="img" aria-label="73 percent went out, 27 percent is left">
       <span class="out" style="--p3-part: 73%"></span><span class="kept"></span>
     </div>
     <p class="p3-split-labels"><span>73% went out</span><span>27% is left</span></p>
   </div>
   The two numbers come from PortalApiPass3 (split.outPercent, split.keptPercent): they add up to 100.
   ========================================================================== */

.p3-split {
  display: grid;
  gap: 8px;
}

.p3-split-bar {
  display: flex;
  gap: 3px;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--p3-bar-track);
}

.p3-split-bar > .out {
  flex: 0 0 var(--p3-part, 50%);
  background: var(--p3-bar-out);
}

.p3-split-bar > .kept {
  flex: 1 1 auto;
  min-width: 6px;
  background: var(--p3-bar-kept);
}

.p3-split-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  color: var(--soft);
  font-size: var(--text-quiet);
}


/* ==========================================================================
   10  QUOTE CARD: one plain sentence with a gold left edge
   <blockquote class="p3-quote"><p>A good month. Supplies and materials were your biggest cost.</p></blockquote>
   ========================================================================== */

.p3-quote {
  margin: 0;
  padding: 18px 22px 18px 24px;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--p3-gold);
  border-radius: 0 var(--p3-radius) var(--p3-radius) 0;
  background: var(--p3-quote-bg);
  color: var(--ink);
  font: italic 400 1.5rem/1.38 var(--serif);
  text-wrap: pretty;
}

/* Engraved cream: a sentence card that sits straight on the page takes the cream paper of every other card
   of that look (navy words), not a dark slab; inside a cream card it keeps its light gold wash */
[data-theme="engraved-cream"] .p3-quote {
  color-scheme: light;
  --ink: var(--p3-cream-ink);
  border-color: var(--panel-line);
  border-left-color: var(--p3-gold);
  background: var(--panel-bg);
  color: var(--p3-cream-ink);
}

[data-theme="engraved-cream"] .panel .p3-quote {
  background: var(--p3-quote-bg);
}

@media (max-width: 699px) {
  .p3-quote {
    padding: 16px 16px 16px 18px;
    font-size: 1.3125rem;
  }
}


/* ==========================================================================
   11  ROWS WITH HAIRLINES, AND ROWS WITH A THIN AMOUNT BAR
   <ul class="p3-rows">
     <li class="p3-row"><span class="p3-row-l">Jobs and service calls</span>
       <span class="p3-row-r"><b class="p3-row-amt amt">$21,460</b><span class="p3-row-sub">up $1,100</span></span></li>
   </ul>
   A row you can press: <a class="p3-row" href="...">. A row with a photo: add class has-thumb and put
   <img class="p3-thumb" src="..." alt=""> first.
   With a thin bar under the name (Breakdown):
   <ul class="p3-barrows">
     <li class="p3-barrow"><span class="p3-row-l">Taxes paid</span>
       <span class="p3-row-r"><b class="p3-row-amt amt">$1,002</b><span class="p3-row-sub">up $35</span></span>
       <span class="p3-mini-bar" aria-hidden="true"><span style="--p3-part: 12.6%"></span></span>
       <span class="p3-row-detail">Payroll taxes $590, sales tax sent in $412</span></li>
   </ul>
   .p3-barrow.gold paints its bar gold (taxes, as in the Breakdown mockup).
   ========================================================================== */

.p3-rows,
.p3-barrows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p3-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  min-height: 52px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}

.p3-row:first-child {
  border-top: 0;
}

.p3-rows.lined {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.p3-rows.lined > .p3-row:first-child {
  border-top: 0;
}

a.p3-row {
  min-height: 56px;
  padding-left: 6px;
  padding-right: 6px;
  border-radius: 6px;
}

a.p3-row:hover {
  background: var(--p3-row-hover);
}

.p3-row-l {
  flex: 1 1 auto;
  min-width: 0;
}

.p3-row-l b,
.p3-row-l .p3-row-name {
  display: block;
  font-weight: var(--w-strong);
}

.p3-row-r {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.p3-row-amt {
  font-weight: var(--w-strong);
  white-space: nowrap;
}

.p3-row-sub,
.p3-row-when {
  color: var(--quiet);
  font-size: var(--text-quiet);
  white-space: nowrap;
}

.p3-row-when {
  display: block;
}

/* a row with a small photo in front ("What you sent"): photo, words, then the status (a pill or an amount).
   Under 480 wide the status moves under the words, so a name never squeezes into one word per line. */
.p3-row.has-thumb {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "thumb words status";
  align-items: center;
  column-gap: 16px;
}

.p3-row.has-thumb > .p3-thumb { grid-area: thumb; }
.p3-row.has-thumb > .p3-row-l { grid-area: words; }
.p3-row.has-thumb > :last-child:not(.p3-row-l):not(.p3-thumb) { grid-area: status; justify-self: end; }

@media (max-width: 479px) {
  .p3-row.has-thumb {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "thumb words"
      "thumb status";
    row-gap: 6px;
    align-items: start;
  }

  .p3-row.has-thumb > :last-child:not(.p3-row-l):not(.p3-thumb) { justify-self: start; }
}

.p3-thumb {
  flex: none;
  width: 76px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

/* the bar takes the whole width under the name and the amount, so every bar of a list has the same
   track and the lengths can be compared at a glance */
.p3-barrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name   amt"
    "bar    bar"
    "detail detail";
  align-items: start;
  gap: 8px 18px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--rule);
}

.p3-barrow:first-child {
  border-top: 0;
}

.p3-barrow > .p3-row-l { grid-area: name; }
.p3-barrow > .p3-row-r { grid-area: amt; }
.p3-barrow > .p3-mini-bar { grid-area: bar; align-self: center; }
.p3-barrow > .p3-row-detail { grid-area: detail; }

.p3-mini-bar {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--p3-bar-track);
}

.p3-mini-bar > span {
  display: block;
  width: var(--p3-part, 0%);
  min-width: 6px;
  height: 100%;
  border-radius: 999px;
  background: var(--p3-bar-out);
}

.p3-barrow.gold .p3-mini-bar > span {
  background: var(--p3-bar-kept);
}

.p3-row-detail {
  color: var(--soft);
  font-size: var(--text-quiet);
}


/* ==========================================================================
   12  STATUS PILLS: dark words on a bright chip
   <span class="p3-pill gold">Checked</span>   <span class="p3-pill have">We have it</span>
   <span class="p3-pill done"><i data-icon="check"></i>Done</span>   <span class="p3-pill plain">In progress</span>
   ========================================================================== */

.p3-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 3px 14px;
  border: 1px solid var(--pill-line, var(--line));
  border-radius: 999px;
  background: var(--pill-bg, transparent);
  color: var(--pill-ink, var(--ink));
  font: 650 1.125rem/1.15 var(--sans);
  letter-spacing: .005em;
  white-space: nowrap;
}

.p3-pill .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.p3-pill.gold { --pill-bg: var(--p3-pill-gold-bg); --pill-ink: var(--p3-pill-gold-ink); --pill-line: var(--p3-pill-gold-line); }
.p3-pill.have { --pill-bg: var(--p3-pill-have-bg); --pill-ink: var(--p3-pill-have-ink); --pill-line: var(--p3-pill-have-line); }
.p3-pill.done { --pill-bg: var(--p3-pill-done-bg); --pill-ink: var(--p3-pill-done-ink); --pill-line: var(--p3-pill-done-line); }
.p3-pill.plain { --pill-bg: var(--p3-line-bg); --pill-ink: var(--ink); --pill-line: var(--line); }


/* ==========================================================================
   13  BUTTONS (on top of portal.css .btn: same sizes, full width on a phone, 48px and more)
   <button class="btn p3-main"><i data-icon="camera"></i>Take a photo</button>     dark teal, white words
   <a class="btn p3-line" href="report.html">Open the full report</a>               gold outline
   <button class="btn p3-gold">Send it</button>                                      gold, dark words
   .p3-pair: two buttons side by side (Print, Leave a note), one under the other under 420 wide.
   ========================================================================== */

.btn.p3-main {
  --b-bg: var(--p3-teal);
  --b-ink: var(--p3-main-ink);
  --b-line: var(--p3-main-line);
  --b-icon: var(--p3-main-ink);
  --b-shadow: var(--p3-main-shadow);
  --b-w: 600;
}

/* darker on hover, never lighter: the white words keep their contrast */
.btn.p3-main:hover {
  filter: none;
  --b-bg: var(--p3-teal-hover);
}

.btn.p3-line {
  --b-bg: var(--p3-line-bg);
  --b-ink: var(--ink);
  --b-line: var(--p3-gold);
  --b-icon: var(--p3-gold-ink);
  --b-shadow: none;
  border-width: 1.5px;
}

[data-theme="engraved-cream"] .panel .btn.p3-line,
[data-theme="engraved-cream"] .popup-box .btn.p3-line {
  --b-line: var(--p3-cream-gold-line);
}

.btn.p3-gold {
  --b-bg: var(--p3-gold-btn-bg);
  --b-ink: var(--p3-gold-btn-ink);
  --b-line: var(--p3-gold-btn-line);
  --b-icon: var(--p3-gold-btn-ink);
  --b-shadow: var(--p3-gold-btn-shadow);
  --b-w: 650;
}

.p3-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.p3-pair > .btn {
  width: 100%;
}

@media (max-width: 419px) {
  .p3-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ==========================================================================
   14  TWO-WAY SWITCH (Simple / Breakdown). portal.js runs it and remembers the choice.
   <div class="p3-switch" data-p3-switch="report-view" role="group" aria-label="How much to show">
     <button type="button" data-value="simple">Simple</button>
     <button type="button" data-value="breakdown">Breakdown</button>
   </div>
   <div data-p3-show="report-view=simple"> ... </div>   <div data-p3-show="report-view=breakdown" hidden> ... </div>
   ========================================================================== */

.p3-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 520px;
  padding: 4px;
  border: 1.5px solid var(--p3-gold);
  border-radius: 14px;
  background: var(--p3-line-bg);
}

.p3-switch > button {
  min-height: 52px;
  padding: 6px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 500 1.25rem/1.15 var(--serif);
  cursor: pointer;
}

.p3-switch > button:hover {
  background: var(--p3-gold-wash);
}

.p3-switch > button[aria-pressed="true"] {
  background: var(--p3-pill-gold-bg);
  color: var(--p3-pill-gold-ink);
  font-weight: 650;
}

.p3-switch > button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}


/* ==========================================================================
   15  THE 4-DOT TRACKER ("Your month")
   <ol class="p3-track" aria-label="Where your month is">
     <li class="done"><span class="p3-dot" aria-hidden="true"></span><span class="p3-step"><span class="sr">Done: </span>Papers in</span></li>
     <li class="done"> ... Sorting</li>
     <li class="now" aria-current="step"><span class="p3-dot" aria-hidden="true"></span><span class="p3-step"><span class="sr">Now: </span>Waiting on you (2)</span></li>
     <li><span class="p3-dot" aria-hidden="true"></span><span class="p3-step"><span class="sr">Next: </span>Done <span class="nowrap">Nov 12</span></span></li>
   </ol>
   The labels may take two or three lines on a phone (18px text); the dots stay on one line.
   ========================================================================== */

.p3-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.p3-track > li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 4px;
  text-align: center;
}

/* the line from the step before to this one */
.p3-track > li::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 13px;
  left: -50%;
  right: 50%;
  height: 3px;
  background: var(--rule);
}

.p3-track > li:first-child::before {
  content: none;
}

.p3-track > li.done::before,
.p3-track > li.now::before {
  background: var(--p3-bar-out);
}

.p3-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border: 3px solid var(--p3-track-next);
  border-radius: 50%;
  background: var(--p3-dot-bg);
}

.p3-track > li.done .p3-dot {
  border-color: var(--p3-bar-out);
  background: var(--p3-bar-out);
}

.p3-track > li.now .p3-dot {
  border-color: var(--p3-gold);
  background: var(--p3-gold);
  box-shadow: inset 0 0 0 4px var(--p3-dot-bg), 0 0 0 4px var(--p3-gold-halo);
}

.p3-step {
  color: var(--soft);
  font-size: 1.125rem;
  line-height: 1.25;
}

.p3-track > li.now .p3-step {
  color: var(--p3-gold-ink);
  font-weight: 650;
}


/* ==========================================================================
   16  MENU SHEET (built by portal.js for data-open="menu"), SMALL PIECES, PRINTING
   ========================================================================== */

.p3-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p3-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid transparent;      /* a real edge: shows in Windows high contrast, and measure.mjs judges the words against it */
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: var(--w-ui) var(--text)/1.2 var(--font-ui);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.p3-menu-item .icon {
  width: 26px;
  height: 26px;
  color: var(--p3-gold-ink);
}

.p3-menu-item:hover {
  background: var(--p3-menu-hover);
}

.p3-menu-item[aria-current="page"] {
  position: relative;
  font-weight: var(--w-strong);
}

/* the page you are on: a short gold bar in front of it */
.p3-menu-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 2px;
  background: var(--p3-gold);
}

@media (min-width: 700px) {
  .p3-menu-pop .popup-box {
    width: min(100%, 480px);
  }
}

/* a calm line with an icon ("Only you and Stingray Bookkeeping can open these.") */
.p3-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--soft);
  font-size: var(--text-quiet);
}

.p3-note .icon {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  color: var(--p3-gold-ink);
}

/* a small gold label over a figure or a heading ("October 2026", "So far") */
.p3-kicker {
  color: var(--p3-gold-ink);
  font: 600 1.125rem/1.2 var(--font-body);
  letter-spacing: .01em;
}

/* Windows high contrast (forced colors): keep the picked half of the switch and the bars visible */
@media (forced-colors: active) {
  .p3-switch > button[aria-pressed="true"] {
    outline: 3px solid CanvasText;
    outline-offset: -3px;
  }

  .p3-split-bar,
  .p3-mini-bar,
  .p3-dot {
    forced-color-adjust: none;
  }
}

@media print {
  .p3-banner,
  .p3-photo,
  .p3-back,
  .p3-switch,
  .p3-menu-pop {
    display: none !important;
  }

  .p3-card,
  .p3-quote {
    border-color: var(--p3-print-line) !important;
    background: none !important;
    box-shadow: none !important;
  }

  .p3-fig-n,
  .p3-fig.kept .p3-fig-n,
  .p3-kicker,
  .p3-track > li.now .p3-step {
    color: var(--p3-print-ink) !important;
  }

  /* the bars and the tracker dots print as they show (their inner parts too, not only the box) */
  .p3-split-bar,
  .p3-split-bar *,
  .p3-mini-bar,
  .p3-mini-bar *,
  .p3-dot {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
