/* =====================================================================
   THE QUICK PREVIEW PANEL — the look of it.

   KEITH, 29 August 2026: "There should be a quick preview panel opening up on
   the right when clicking on any of the record.. one click to preview and
   double clic to open.. make this a standard when there is a preview panel.
   and one click to open when there s no preview panel."

   IT IS ITS OWN STYLESHEET AND NOT A BLOCK IN style.css, for the same reason
   the New project screens have project-entry.css: this is one component that
   arrives with one behaviour file, and the shell's `headHtml` seam
   (src/app.js: page()) exists precisely so a component can bring its own rules
   without a 300kb file growing another section.

   NOTHING NEW IS INVENTED HERE. Every colour, radius, space and size below is
   a token declared in public/style.css — the same panel white, the same hairline
   rule, the same rounded rectangle, the same 13px data floor. The panel reads
   as another surface of the application, not as a widget dropped onto it.

   AT DESK WIDTH THE PANEL IS A COLUMN OF THE PAGE, NOT A THING FLOATING OVER
   IT. The application shell is already a grid at 768px and up — head across the
   top, rail down the left, main to the right of it. Opening the panel adds a
   THIRD track, so the list narrows and re-flows beside it instead of being
   covered by it: nothing a reader was looking at goes behind the panel, the
   sticky page top and the sticky column headings keep working untouched, and
   closing it gives the width straight back.

   AND BELOW THAT WIDTH IT IS THE SAME PANEL AS A SHEET OVER THE LIST —
   KEITH, 19 September 2026, choosing Option B from the two drawn in
   docs/2026-09-19-quickview-on-ipad-mockup.html: "Option B - over".

   Until that morning there was no panel at all below the line and a tap on a
   row gave an iPad reader nothing. There is not room for a third track at that
   width — which is why Option A, lowering the cut-off, was the option NOT
   chosen — so the panel stops being a column and lies over the list instead:
   the list keeps every pixel of its width and every column where it was, the
   row that was tapped is still selected behind the sheet, and closing it gives
   the list back exactly as it was left, with nothing re-flowed and no scroll
   position lost. It is the shape Ask Kate already opens in (Keith: "Panel over
   the current page"), so it is one thing to learn and not two.

   1280px IS WRITTEN ONCE IN THIS FILE, and it is not a number this file
   invented: it is the app's own iPad/desk boundary (style.css: "1280 is 16.1's
   own breakpoint token"). The two bands below are exact complements of one
   another — `not all and (min-width: 1280px)` is the sheet, `(min-width:
   1280px)` is the column — so no rule can apply to both and there is no second
   measurement to keep in step with the first. public/list-preview.js reads the
   same 1280 in one constant of its own, so the look and the behaviour cannot
   disagree about where the line is.
   ===================================================================== */

:root {
  /* A dimension, not a gap, so it is its own token rather than a step off the
     spacing scale — the same construction --status-box-w uses. Wide enough for
     a company name and a phone number on one line each, narrow enough that the
     list keeps the width it gained on 29 August 2026. */
  --preview-w: 340px;
}

/* NOTHING IS DRAWN UNTIL A ROW IS PRESSED, at either width. `preview-open` on
   the document is the one thing that draws any of the three, and it is put there
   by public/list-preview.js at the moment of the click and taken off when the
   panel closes. The tab that reopens a collapsed panel is drawn only in the desk
   band, because collapsing is a desk act — see the sheet's own note below. */
.preview-panel { display: none; }
.preview-tab { display: none; }
.preview-scrim { display: none; }

/* =====================================================================
   THE SHEET — BELOW THE DESK BREAKPOINT. Keith: "Option B - over".

   IT IS THE SAME PANEL. Everything after the two bands — the head, the ladder,
   the facts, the editor, the foot — is one rule set for both shapes, so a sheet
   and a column can never come to hold different things. What a band changes is
   only WHERE the panel is: a track of the grid up there, a fixed sheet against
   the right edge down here.

   OVER THE LIST, AND OUT OF THE LAYOUT. `position: fixed` means the sheet takes
   no column and no space, so the list underneath keeps its full width, every
   column stays where it was, and nothing re-flows when the sheet opens or
   closes. It is the construction the navigation drawer already uses at these
   widths (public/style.css .nav-rail), which is why the numbers below are that
   drawer's numbers and not new ones.

   IT STARTS UNDER THE APP BAR, like the drawer, so the bar the reader came in
   through is never covered and the page can still be navigated away from with
   the sheet up.

   THE WAY OUT IS THREE WAYS, and the sheet needs them all because it covers
   what it is about: the ✕ in its own corner (.pv-close, drawn below), a tap on
   the dimmed list behind it (.preview-scrim), and the Escape key. All three are
   public/list-preview.js; what this file does is draw the scrim and make it a
   surface big enough to hit.

   AND THE CHEVRON STANDS DOWN. Collapsing folds the panel away while keeping
   the row selected and leaves a 26px tab against the screen edge to bring it
   back — a desk act, for a panel that is costing the list width. A sheet costs
   the list nothing and is already gone the moment it is closed, so the control
   would be a second, weaker Close. It is hidden rather than removed because the
   same head is drawn at both widths.
   ===================================================================== */
@media not all and (min-width: 1280px) {
  html.preview-open .preview-panel {
    display: block;
    position: fixed;
    /* Under the app bar, hard against the right edge, to the foot of the window
       — the drawer's own inset, mirrored to the side the quick view has always
       opened on (Keith: "quick view is always on the right"). */
    inset: var(--appbar-h) 0 0 auto;
    /* THE SAME 340px IT IS AT DESK WIDTH, so the panel is one drawing and the
       reader meets one thing. `min()` is only a floor for a window narrower
       than the panel, where a sheet wider than the screen would be unreachable
       at one edge. */
    width: min(var(--preview-w), 100vw);
    /* ABOVE THE LIST AND ITS FROZEN TOP, BELOW THE NAVIGATION DRAWER. The list's
       sticky column headings stand at 3 and its filter bar at 10
       (public/style.css), so a sheet at `auto` would have the headings painted
       through it. The drawer is 60 over a scrim at 55 and must stay on top of
       both, because it is the way off the page. */
    z-index: 50;
    overflow-y: auto;
    padding: var(--space-md) var(--space-md) var(--space-lg);
    background: var(--panel);
    border-left: 1px solid var(--line);
    /* IT SLIDES IN FROM THE RIGHT — Keith's own word for this option, "over",
       drawn in the mock-up as a sheet coming in over the list. An animation
       rather than a transition because the panel arrives from `display: none`,
       which a transition cannot start from. The shell's reduced-motion block
       (public/style.css) already cuts every animation in the app to nothing, so
       a reader who has asked for stillness gets the sheet without the slide. */
    animation: pv-sheet-in 160ms ease;
  }

  /* THE PAGE BEHIND IS DIMMED, AND A TAP ON IT PUTS THE SHEET AWAY — the same
     pair the navigation drawer makes at these widths. The dimming is what says
     the list is not what is being worked at this moment; being a full surface
     is what makes "tap anywhere off it" a real way out on a touch screen. */
  html.preview-open .preview-scrim {
    display: block;
    position: fixed;
    inset: var(--appbar-h) 0 0 0;
    z-index: 45;
    background: var(--scrim);
    animation: pv-scrim-in 160ms ease;
  }

  /* See the note above: the chevron is a desk control and has nothing to fold
     away here. Held by specificity rather than by source order, so the shared
     rule that draws the two head controls stays one rule. */
  html.preview-open .preview-panel .pv-collapse { display: none; }
}

/* =====================================================================
   AND ON A PHONE THE SHEET COMES UP FROM THE FOOT, FULL WIDTH.
   KEITH, 19 September 2026, looking at the sheet built that afternoon on a
   phone: the quick view is "a FULL-WIDTH sheet that slides UP FROM THE BOTTOM".

   WHAT WAS WRONG. The band above gives the sheet the same 340px it has at desk
   width, which is right on an iPad and wrong on a handset: at 390px it left
   exactly 50px of list showing down the left edge — a strip too narrow to read a
   column in and too wide to be nothing, with the checkbox column stranded in it.
   Measured before this band: `node scripts/quickview-sheet-shots.mjs --shots
   docs/reports/w2833-phone-sheet/before`, phone-portrait — the panel at x=50,
   340 wide, in a 390px window.

   768 IS NOT A NUMBER THIS FILE INVENTED EITHER. It is the app's own phone/iPad
   line — public/style.css, "up to 767px — COMPACT … 768–1023px — MEDIUM (an
   iPad upright)" — and it is the boundary every other phone rule in the shell
   already turns on. This band is the exact complement of that `(min-width:
   768px)`, so it is stated once here and cannot drift from the shell's.

   WHICH LEAVES THE IPAD EXACTLY WHERE 0abbb945 PUT IT. An iPad upright is 768px
   and an iPad on its side is 1024px, so neither enters this band and the side
   sheet they were given is untouched. A phone ON ITS SIDE is 844px wide and does
   not enter it either — at that width the panel is 340px with 504px of list
   beside it, which is the iPad's shape and not the strip Keith was looking at.

   NOTHING NEW IS INTRODUCED. The rounded top and the handle's own ends are
   --r-md, the handle's ink is --line, the reserve above the sheet is --tap:
   every one of them is already declared in public/style.css and the sheet takes
   no colour that was not on the screen before. The radius is the house corner
   and not a bigger one, because Keith's rule is that every element in SGE wears
   ONE corner shape — "rather than that, probably we should all standardize to
   the square or rectangular with a round corner" — and a sheet is no more an
   exception to it than a card is.

   THE THREE WAYS OUT ARE UNTOUCHED AND MUST STAY THAT WAY. The ✕ and Escape are
   public/list-preview.js and read no width at all. The third is a tap on the
   dimmed list, so the dim has to remain reachable: a sheet grown to the full
   height of the window would bury it and leave two ways out where Keith asked
   for three. That is what the max-height is — the window, less the app bar above
   it, less one --tap: whatever the sheet holds, at least a 44px band of scrim is
   left standing above it, which is SGE's own floor for a thing a finger must
   hit.
   ===================================================================== */
@media (max-width: 767.98px) {
  html.preview-open .preview-panel {
    /* ACROSS THE FOOT, EDGE TO EDGE. `inset` is restated whole rather than
       patched, so the two anchorings can never half-apply to one another:
       `auto` at the top is what lets the sheet be as tall as what it holds and
       grow upward from the bottom instead of down from the bar. */
    inset: auto 0 0 0;
    width: auto;
    max-height: calc(100vh - var(--appbar-h) - var(--tap));
    /* The hairline moves to the edge the sheet now meets the page along, and
       the corners it meets it at are rounded — the shape a phone sheet has
       everywhere, so there is nothing here to learn. */
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: var(--r-md) var(--r-md) 0 0;
    /* UP, NOT ACROSS. Keith's own word for this one was "slides UP FROM THE
       BOTTOM"; the shell's reduced-motion block cuts it to nothing for a reader
       who has asked for stillness, exactly as it cuts the sideways one. */
    animation: pv-sheet-up 160ms ease;
  }

  /* THE GRAB BAR, WHICH IS A LOOK AND NOT A GESTURE. It is what says "this came
     up and can go back down" on a phone, and it is drawn rather than written
     because every phone sheet a salesperson already uses draws it. It is
     decoration and carries no meaning of its own, so it is a pseudo-element with
     no text and nothing for a screen reader to meet — the ✕ above it is the
     announced control, and it has not moved.

     36 x 4 is the bar the platform sheets draw and is small enough that the
     panel's own top padding holds it without the head moving down a line. The
     radius is the house corner, which on a 4px bar rounds its ends off
     completely — a capsule is what the SHAPE gives here, not a token SGE does
     not use. */
  html.preview-open .preview-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    margin: 0 auto var(--space-sm);
    border-radius: var(--r-md);
    background: var(--line);
  }
}

@keyframes pv-sheet-in { from { transform: translateX(100%); } }
@keyframes pv-sheet-up { from { transform: translateY(100%); } }
@keyframes pv-scrim-in { from { opacity: 0; } }

@media (min-width: 1280px) {
  /* THE PANEL'S OWN TRACK. Only while the panel is open, so a list with nothing
     selected keeps every pixel of the width it has today.

     THE RAIL'S TRACK IS READ, NOT REPEATED. From 1280px up the navigation is a
     rail standing on the page (public/style.css, "THE DESKTOP NAVIGATION IS A
     RAIL, NOT A DRAWER"), and its width is whatever `--rail-w` says at this
     moment — 56px slim, 232px with the names shown, and the reader's own choice
     decides which. Writing the number here instead would mean the panel and the
     rail could disagree about where the page starts. */
  html.preview-open body:has(.appbar) {
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--preview-w);
    grid-template-areas: "rail head head" "rail main aside";
  }

  /* THE SAME PANEL, ON THE OTHER SIDE — Keith, 30 August 2026, on the calendar:
     "Each click on the event should open a quick view panel on the left."

     ONE COMPONENT WITH A SIDE, NOT TWO PANELS. Everything below the grid — the
     panel's own material, its head, its facts, its foot, its collapse, its
     close — is the SAME rule set for both sides. What a side changes is which
     of the two tracks the panel takes and which edge carries its hairline, so
     there is exactly one thing to keep right when the panel changes.

     public/list-preview.js puts `preview-left` on the document when the thing
     that was clicked asked for it (`data-preview-side="left"`), and takes it off
     when the panel closes. A list asks for nothing, so every list in SGE keeps
     its panel exactly where it is — this whole block is inert on those pages. */
  html.preview-open.preview-left body:has(.appbar) {
    grid-template-columns: var(--rail-w) var(--preview-w) minmax(0, 1fr);
    grid-template-areas: "rail head head" "rail aside main";
  }
  html.preview-open.preview-left body:has(.appbar) > .preview-panel {
    border-left: 0;
    border-right: 1px solid var(--line);
  }
  /* The collapsed panel's way back moves with it, and points the other way. */
  html.preview-open.preview-left.preview-collapsed .preview-tab {
    right: auto; left: 0;
    border-right: 1px solid var(--line); border-left: 0;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    /* The chevron is a DIRECTION, so on this side it points the other way. The
       glyph is set in JavaScript and is the same character either way; mirroring
       it here keeps the two sides one component rather than two. The tab's own
       centring transform is repeated because a transform replaces, never adds. */
    transform: translateY(-50%) scaleX(-1);
  }
  html.preview-open.preview-left .pv-collapse { transform: scaleX(-1); }

  /* COLLAPSED: the panel is put away and the list takes the width straight back —
     its track is not created at all, so nothing is reserved for a panel that is
     not on the screen. This is the right-hand half of Keith's instruction of
     29 August 2026 ("when will you build the right navigation column to be able
     to collapse?"): what is not being used holds no space. The record stays
     selected, so expanding brings the same preview back rather than making the
     reader find their row again. */
  html.preview-open.preview-collapsed body:has(.appbar) {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    grid-template-areas: "rail head" "rail main";
  }
  html.preview-open.preview-collapsed body:has(.appbar) > .preview-panel { display: none; }

  /* AND THE WAY BACK IS ALWAYS ON THE SCREEN. A tab against the right edge, in
     the panel's own material, so a collapsed panel can never be a preview the
     reader has no way to reopen. */
  html.preview-open.preview-collapsed .preview-tab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 50%; right: 0; z-index: 40;
    transform: translateY(-50%);
    width: 26px; height: 76px; padding: 0;
    border: 1px solid var(--line); border-right: 0;
    border-radius: var(--r-sm) 0 0 var(--r-sm);
    background: var(--panel); color: var(--t2); cursor: pointer;
  }
  html.preview-open.preview-collapsed .preview-tab:hover { background: var(--panel-2); color: var(--t1); }

  html.preview-open body:has(.appbar) > .preview-panel {
    grid-area: aside;
    display: block;
    /* It stays beside the row while the list scrolls, and scrolls itself when
       it is the taller of the two. --appbar-h is the app bar's own height, the
       same offset the filter bar and the column headings already pin to. */
    position: sticky;
    top: var(--appbar-h);
    align-self: start;
    max-height: calc(100vh - var(--appbar-h));
    overflow-y: auto;
    padding: var(--space-md) var(--space-md) var(--space-lg);
    background: var(--panel);
    border-left: 1px solid var(--line);
  }

  /* AND THE LIST DOES NOT PUSH THE PAGE SIDEWAYS TO MAKE ROOM.
     Catalogue 16.1 tier 1: "the page scrolling sideways is a defect." With the
     panel open the list column is ~340px narrower, so a ten-column table that
     fitted a moment ago may not — and a table has no way of its own to stop
     growing.

     THE SCROLL BELONGS TO THE LIST'S WRAPPER, NOT TO THE TABLE. This is the one
     thing that changed on 29 August 2026 in the evening, and it is what Keith
     was looking at when he asked "Look whyis the Right Big Empty space still
     there?".

     What was here before made the TABLE ITSELF the scroll container —
     `display: block; overflow-x: auto`. A block-level table loses table layout:
     its sections sit in an anonymous table box that is width:auto, so the rows
     shrink-wrapped to their content and stopped at about x=860 on /customers at
     1920 while the panel stood at 1580. Some seven hundred pixels of bare grey
     between the last column and the panel — measured, and photographed at
     docs/reports/w1363-shell/before/customers-desk-1920-panel-open.png. Putting
     `width: 100%` on the table stretched the SCROLLPORT and not the rows, so the
     band survived it; making thead and tbody each a table of their own was tried
     and measured too, and auto layout sized the two sections separately, pulling
     the headings 235px off their own columns.

     The list already HAS a wrapper — `<div class="list-results">`, src/lists.js —
     and it is the same construction .growth-list-scroll and .events-table-scroll
     use. Scrolling it instead leaves the table a TABLE: one layout for headings
     and rows together, filling the column it was given, with the sideways scroll
     still contained so the page never moves.

     AND ONLY WHILE THE PANEL IS ACTUALLY BESIDE THE LIST. Collapsed, the list has
     the whole window back and needs none of this containment, so these rules
     stand down with the panel. */
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main .list-results {
    overflow: auto;
    /* THE HEADINGS STILL DO NOT SCROLL AWAY WITH THE ROWS — Keith, 27 August
       2026, is why they stick at all, and opening a panel is no reason to lose
       it. A sticky heading needs a bounded scrollport to stick inside, so the
       wrapper is bounded to the height it actually has: the window, less the
       chrome frozen above it. The two measurements are the two the shell already
       declares — the app bar alone, and the app bar plus the frozen list top. */
    max-height: calc(100vh - var(--appbar-h));
  }
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main .filter-bar ~ .list-results {
    max-height: calc(100vh - var(--appbar-h) - var(--list-bar-h));
  }
  /* THE OFFSET BELONGS TO WHOEVER SCROLLS, and here that is the wrapper. See
     public/style.css, "AN OFFSET THAT DESCRIBES THE WINDOW MEANS NOTHING INSIDE
     A SCROLLPORT": `top: calc(56px + var(--list-bar-h))` is 160px below the app
     bar while the window scrolls the list, and 160px INSIDE the list the moment
     the list scrolls itself. */
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main .list-results thead th { top: 0; }
  /* AND THE TABLE FILLS THE COLUMN. It stays a table — no `display: block` — so
     one layout sizes the headings and the rows together and neither can drift
     from the other. `min-width: 100%` is what stretches it to the wrapper while
     still letting a genuinely wider table be wider and scroll inside it.

     TWO WRAPPERS, NOT ONE. The Accounts list gained a second box on 29 August
     2026 — `<div class="acct-scroll" data-list-scroll>` (src/lists.js:
     listScrollHtml), which is what actually scrolls now, with `.list-results`
     around it. The table is therefore no longer a child of `.list-results`, so
     this rule stopped reaching it and the catch-all below caught it instead:
     `display: block` shrink-wrapped the rows to about x=993 while the box ran on
     to the panel. That is the band Keith photographed on 29 August 2026 — "When
     the right panel is opened, there is a big white space" — measured at 587px
     at 1920 and 107px at 1440 before this line. A scroll wrapper is named by its
     own marker rather than by class, so a list built tomorrow through
     listScrollHtml is covered without being told. */
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main .list-results > table {
    min-width: 100%;
  }
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main [data-list-scroll] > table {
    min-width: 100%;
  }
  /* A TABLE WITH NO WRAPPER — the Dashboard's own, a report's — still must not
     take the page sideways with it. Those are narrow tables in a column that
     only narrows by the panel's width, so containing them is enough; they carry
     no sticky headings of their own, which is why the block form is safe here
     and was not on a list. A table that already sits in a scroll box of its own
     is excluded for exactly the reason the block form was taken off lists. */
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main
  :not(.list-results):not([data-list-scroll]) > table:not(.cal-week):not(.cal-month):not(.cal-day):not(.compared):not(.growth-revenue):not(.debrief-dl) {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    width: 100%;
  }
  /* And the offset belongs to whoever scrolls here too — that table is now its
     own scrollport, so the shell's window-measured `top` means nothing inside
     it. test/list-header-offset.test.js gates exactly this pairing. */
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main
  :not(.list-results):not([data-list-scroll]) > table:not(.cal-week):not(.cal-month):not(.cal-day):not(.compared):not(.growth-revenue):not(.debrief-dl)
  thead th { top: 0; }
  html.preview-open:not(.preview-collapsed) body:has(.appbar) > main svg { max-width: 100%; height: auto; }
}

/* ---- the head: what this record is, and the way out ---------------------- */
/* TWO ROWS, AND EVERY CELL PLACED BY HAND — Keith, 4 September 2026, drawing a
   red box on the activity panel (~/Vault/Attachments/SGE/2026-09-04-195613-image.png):
   "Can the Edit icon be placed around this red box?" His box is at the panel's
   RIGHT EDGE, on the row BELOW the header, level with the subtitle line.

     row 1   what kind of record this is and its name  |  chevron, close
     row 2   the subtitle                              |  Edit

   THE CHEVRON AND THE CLOSE HAVE NOT MOVED. They are the two ways of putting
   the panel away and they keep their corner; only Edit changed place.

   PLACEMENT IS EXPLICIT BECAUSE ROW TWO CAN BE HALF EMPTY. A record with no
   subtitle hides `.pv-sub`, and a reader with nothing to edit hides
   `.pv-edit-open`; under automatic placement a lone Edit would fall into the
   empty left cell and sit under the record's name instead of against the edge.
   Naming the column and the row for each of the four makes that impossible. */
.preview-panel .pv-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0 var(--space-xxs);
  margin: 0 0 var(--space-md);
}
.preview-panel .pv-id { grid-column: 1; grid-row: 1; min-width: 0; }
/* The two small controls sit together against the right edge, in the order they
   have always been in. */
.preview-panel .pv-head-away {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: var(--space-xxs);
}

/* The micro-label above the name, in the eyebrow's own words and size — it says
   WHAT KIND of record this is, which is the one thing a panel that can hold six
   kinds of record has to say before anything else. */
.preview-panel .pv-kind {
  margin: 0 0 var(--space-xxs);
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1.29;
  letter-spacing: var(--ls-caption);
  color: var(--t3);
}
.preview-panel .pv-kind:empty { display: none; }

.preview-panel .pv-title {
  margin: 0;
  font-size: var(--fs-tagline);
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: var(--ls-tagline);
  color: var(--t1);
  overflow-wrap: anywhere;
}
.preview-panel .pv-sub {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  margin: var(--space-xxs) 0 0;
  font-size: var(--fs-caption);
  line-height: 1.43;
  letter-spacing: var(--ls-caption);
  color: var(--t3);
}
.preview-panel .pv-sub:empty { display: none; }

/* COLLAPSING IS ONE ACTION AND IT IS WHERE THE EYE ALREADY IS — beside Close,
   so the pair reads as "put it away" and "be done with it". Keith, 29 August
   2026: "when will you build the right navigation column to be able to
   collapse?"

   SMALL AND QUIET — Keith, 29 August 2026, looking at this panel: "Can the icons
   be smaller." They were two 44px boxes each wearing a full hairline border, and
   between them they claimed 88px of a 340px header: the two controls for leaving
   the panel were drawn louder than the name of the record in it. They are 26px
   now, with no border and no fill until the pointer is on them, which is what a
   quiet icon button is.

   THE TARGET DID NOT SHRINK WITH THE BOX. `::after` reaches 9px past every edge
   — 26 + 18 = 44 — so the thing a pointer must hit is still the 44px square
   catalogue 16.6 tier 1 asks for, while the thing an eye sees is 26. It is a
   pseudo-element rather than padding because padding would have made the drawn
   box big again, which is the whole of what Keith objected to. */
.preview-panel .pv-collapse,
.preview-panel .pv-close {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  /* `min-height` AS WELL AS `height`. The document's own `button` rule sets
     min-height to var(--tap), and a min-height beats a height — without this
     line the control is 26 wide and still 44 tall, which is half a fix: the
     header keeps the height Keith was looking at. The 44px TARGET is the
     `::after` below, which is where it belongs. */
  height: 26px;
  min-height: 26px;
  padding: 0;
  font-family: var(--font);
  font-size: var(--fs-caption);
  line-height: 1;
  color: var(--t3);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.preview-panel .pv-collapse::after,
.preview-panel .pv-close::after {
  content: '';
  position: absolute;
  inset: -9px;
}
.preview-panel .pv-collapse:hover,
.preview-panel .pv-close:hover {
  color: var(--t1);
  background: var(--panel-2);
}

/* THE EDIT ICON — KEITH, 4 September 2026: "All Qucik view panels are to be
   editable by clicking on a "Edit" icon".

   WHERE IT SITS: the right-hand end of the row below the header, level with the
   subtitle, which is where Keith's red box is
   (~/Vault/Attachments/SGE/2026-09-04-195613-image.png). `justify-self: end`
   holds it against the panel's right edge whether or not there is a subtitle
   beside it.

   IT IS THE SAME QUIET ICON BUTTON the two controls above it are — the same
   26px box, the same borderless rest state, the same wash on hover, the same
   44px target reaching out from `::after`. Keith's instruction of 29 August
   2026, "Can the icons be smaller", was about this corner of this panel, and a
   control drawn any louder than the two he was looking at would undo it.

   IT CARRIES HIS WORD AS WELL AS THE MARK. A pencil alone is a guess; the word
   is set by the server (src/preview-edit.js WORDS.edit) and shown beside it, so
   the control says what it does. The word is the caption size and sits tight
   against the mark, which is why this button is wider than the other two and is
   the only one that is. */
.preview-panel .pv-edit-open {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: center;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxs);
  /* `width: auto` IS LOAD-BEARING. The document's own `button` rule is
     `width: 100%` (public/style.css), which is why the two controls beside this
     one state 26px rather than leaving it to the content. Without this line the
     Edit button took the whole head and squeezed the record's name to one
     character per line — measured at 1440 on /customers, 4 September 2026. */
  width: auto;
  height: 26px;
  min-height: 26px;
  padding: 0 var(--space-xxs);
  font-family: var(--font);
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--ls-caption);
  color: var(--t3);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.preview-panel .pv-edit-open::after { content: ''; position: absolute; inset: -9px; }
.preview-panel .pv-edit-open:hover { color: var(--t1); background: var(--panel-2); }
.preview-panel .pv-edit-open[hidden] { display: none; }
/* THE MARK IS A DRAWING, NOT A LETTER — Keith, 4 September 2026: "The icon also
   look low resolution."

   It was the character U+270E, LOWER RIGHT PENCIL, set in the page font. No font
   SGE loads carries that codepoint, so it fell through to whatever the system
   had — on macOS the bitmap emoji face, which is why it alone looked soft beside
   the crisp chevron and close next to it. A glyph cannot be sharpened; it had to
   stop being a glyph, so it is an inline SVG now
   (public/list-preview.js editIconSvg) in the one style every other icon in SGE
   is drawn in: a 24-unit viewBox, no fill, `currentColor` for the stroke, round
   caps and joins.

   THE COLOUR IS THE BUTTON'S, unchanged: `currentColor` follows `.pv-edit-open`
   from --t3 at rest to --t1 on hover, so the mark and the word beside it move
   together exactly as the glyph and the word did.

   THE SIZE IS 18px AND THE WEIGHT IS MATCHED ON WHAT IS DRAWN. SGE's nav icons
   (src/app.js navIcon) are 20px wide at stroke-width 1.6 on the same 24 grid, so
   the line that lands on the screen is 1.6 x 20/24 = 1.33px. This one is drawn
   at 18px — it sits inside a 26px control — so the SVG states stroke-width 1.8,
   and 1.8 x 18/24 = 1.35px. The same line, in a smaller drawing. */
.preview-panel .pv-edit-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
}

/* ---- the facts ----------------------------------------------------------- */
/* Label above value, not label beside it: in a 340px column a two-column
   arrangement truncates the very values the panel exists to show. */
/* ---- THE STAGE BAR IN THE PANEL ------------------------------------------
   KEITH, 4 September 2026: "Can the process bar be in the quick view panel as
   well. Same for all quick view panel if a process bar is applicable"

   THE BAR ITSELF IS THE RECORD PAGE'S OWN `.stagebar` (public/style.css) and
   not a second drawing of one — the tracks, the fills, the ink and the note
   are that rule's. What is here is only what the PANEL has to say about it:
   where it sits, and that six steps must fit a 340px column.

   NO NAME BREAKS MID-WORD HERE. The rungs used to be six EQUAL columns of the
   panel's width — 44px each, measured — and a 44px column breaks "Identified"
   into "Identifi/ed". A word is never broken on screen and the stage names are
   Keith's and may not be shortened, so it is the LAYOUT that gives: the columns
   are sized to the name in them instead of to each other. See the sizing rule
   further down. */
.preview-panel .pv-bar {
  margin: var(--space-sm) 0 0;
  max-width: none;
  min-width: 0;
  gap: var(--space-xxs);
}
.preview-panel .pv-bar[hidden] { display: none; }
.preview-panel .pv-bar .stagebar-name {
  font-size: var(--t-cell-min);
}
/* EVERY LADDER IN THE PANEL LIES FLAT — Keith, 6 September 2026: "So the Growth
   Ladder in contact quick view should follow the Growth ladder in Account quick
   view."

   WHAT WAS HERE. A bar with five rungs or more turned on its side: the six-rung
   contact ladder became a stack of rows down the panel while the four-rung
   account ladder stayed abreast, so the two panels drew the same idea two
   different ways and a reader had to learn both. The rule was written for a real
   measurement — six names abreast in a 340px column gives each about 47px — but
   the answer to that is the names wrapping, not the bar changing shape.

   SO THE BAR STAYS ABREAST AND THE RUNGS GIVE. The rungs stay in one row and the
   tracks stay level with each other; what changed on 6 September 2026 is that
   each rung is now as wide as its own NAME rather than an equal sixth of the
   panel (the rule below), because an equal sixth is 44px and 44px breaks
   "Identified" in half. The whole ladder is still drawn, which is Keith's own
   rule ("these full stage should be shown up… the more it is filled it clearer
   the users will know").

   THE NEIGHBOURS CANNOT RUN INTO EACH OTHER, and the gap is what holds them
   apart. It is 4px and not 8: with the rungs sized to their names, six names and
   five 8px gaps came to 321px in a 305px bar and the last rung hung off the end
   (measured — `node scripts/w1745-shots.mjs`, barOverflows). 4px is the smallest
   gap the shell has a token for and it is enough to read two names as two. */
.preview-panel .pv-bar {
  column-gap: var(--space-xxs);
}
/* AND EACH RUNG IS AS WIDE AS ITS OWN NAME — 6 September 2026.
   A WORD IS NEVER BROKEN ON SCREEN. The base `.stagebar` (public/style.css) gives
   every rung an equal share of the row — `grid-auto-columns: minmax(0, 1fr)` —
   which is right on a record page with room to spare and wrong in a 340px panel:
   six equal shares are 44px each and "Identified" is 62px, so five of the six
   names broke mid-word. Measured before this rule: every name 44px wide, five of
   them on two lines (`node scripts/w1745-shots.mjs`, before-measures.json).

   `max-content` COLUMNS ARE THE FIX. Each rung takes the width its name needs and
   no more, so the six add up to about the width the panel has; `nowrap` is what
   makes a break impossible rather than merely unlikely. The rungs are then
   UNEQUAL, and that is the trade: a stage bar whose segments are not all the same
   width still says how far along the reader is, and a name split across two lines
   does not say anything.

   THE WHOLE LADDER IS STILL DRAWN and still lies flat — Keith's two rules on it
   ("these full stage should be shown up… the more it is filled it clearer the
   users will know", and "the Growth Ladder in contact quick view should follow
   the Growth ladder in Account quick view"). Neither the bar's shape nor the
   number of rungs changed. */
.preview-panel .pv-bar {
  grid-auto-columns: max-content;
  justify-content: space-between;
}
.preview-panel .pv-bar .stagebar-name {
  white-space: nowrap;
  overflow-wrap: normal;
  hyphens: none;
}

.preview-panel .pv-facts {
  margin: 0;
  padding: var(--space-sm) 0 0;
  border-top: 1px solid var(--line-soft);
}
.preview-panel .pv-facts > dt {
  margin: 0;
  font-size: var(--fs-caption);
  line-height: 1.43;
  letter-spacing: var(--ls-caption);
  color: var(--t3);
}
.preview-panel .pv-facts > dd {
  margin: 0 0 var(--space-sm);
  font-size: var(--fs-body);
  line-height: 1.47;
  letter-spacing: var(--ls-body);
  color: var(--t1);
  overflow-wrap: anywhere;
}
.preview-panel .pv-facts > dd:last-child { margin-bottom: 0; }
/* THE FACTS STAND DOWN WHILE THE FORM IS UP. Keith's shape for the Edit icon is
   that it "turns it into a form in place" — the panel becomes the form rather
   than growing one underneath what was already there, which in a 340px column
   would put the thing a person came to do below a screenful of what they had
   already read. */
.preview-panel .pv-facts[hidden] { display: none; }

/* ---- WHERE THE WORK IS DONE ---------------------------------------------- */
/* KEITH, 2 September 2026, on the Inbound leads panel: "It's possible that this
   quick view button that's opening now allows the users to be able to. So that
   they don't need to go into the record in order to key in." And, asked whether
   it was leads alone: "apply this everywhere."

   THE BLOCK SITS BETWEEN THE FACTS AND THE FOOT, and is separated from the facts
   by the same hairline the foot uses — so the panel reads as three things in the
   order a person meets them: what this record is, what I can change about it,
   and the way out.

   NOTHING NEW IS INVENTED HERE EITHER. The label is the facts' own `dt` type and
   colour, the control is the document's own `select`, the Save is `.btn-primary`
   as the record pages draw it, and the hairline, radii and spaces are the same
   tokens the rest of this sheet uses.

   AND IT IS INSIDE THE PANEL, so it exists exactly where the panel exists: at
   desk width, on the right for a list and on the left for the calendar, and not
   at all below 1280px. Nothing in this section states a width, a side or a
   breakpoint of its own — it cannot appear where the panel refuses to, because
   it is drawn only as part of it. */
.preview-panel .pv-edit {
  margin: var(--space-lg) 0 0;
  padding: var(--space-md) 0 0;
  border-top: 1px solid var(--line-soft);
}
.preview-panel .pv-edit[hidden] { display: none; }

/* WITH THE FACTS GONE THE BLOCK IS THE PANEL'S BODY, not a section under
   something, so it drops the rule and the space that separated it from what is
   no longer there. */
.preview-panel.is-editing .pv-edit {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* ---- THE RECORD'S OWN FORM, INSIDE THE PANEL ----------------------------- */
/* KEITH, 4 September 2026: "All Qucik view panels are to be editable by clicking
   on a "Edit" icon", and the user "saves or cancels from the panel".

   NOTHING HERE RESTYLES THE FORM. What is in this box is the very markup the
   record's own edit screen renders — the same labels, the same controls, the
   same required marks, the same helper sentences — moved in by
   public/list-preview.js. Its type and colour are public/style.css's, exactly as
   they are on the record page, and they are not touched: a field that reads one
   way on the record page and another in the panel is two designs for one form.

   WHAT IS SET IS THE WIDTH, AND ONLY THE WIDTH. A form laid out for a page has
   two-up rows (`.f-half`, `.fgrid`) and controls sized for a wide column; in a
   340px track those must become one column and must not push the panel sideways.
   That is a consequence of the container, which is this file's business. */
.preview-panel .pv-edit-form:empty { display: none; }
.preview-panel .pv-edit-form .fgrid { display: block; }
.preview-panel .pv-edit-form .f-half,
.preview-panel .pv-edit-form .f-narrow,
.preview-panel .pv-edit-form .fcell { width: auto; max-width: 100%; }
/* A TICK IS NOT A FIELD — Keith, 4 September 2026: "The products shown looks
   wrong … layout".

   This rule is what was actually wrong with "Products shown". A checkbox is an
   <input>, so `width: 100%` made every one of the five ticks as wide as the
   whole 340px column; the product name beside it, being a flex item that cannot
   shrink below its own text, was pushed clean out of its tile. That is the
   screenshot he sent (~/Vault/Attachments/SGE/2026-09-04-195856-image.png):
   "Ko", "Ko", "Ko", "Sinl Cov", and the last name on a line of its own.
   Measured in the activity panel at 1440 on 4 September 2026.

   A checkbox and a radio keep their own size everywhere in SGE (public/style.css
   `label.otile > input`), and the panel has no reason to be the exception. Every
   other control still fills the column, which is what the rule was written for. */
/* `max-width: 100%` came off on 18 September 2026. It was a no-op against the
   column for everything wide, and against everything NARROW it beat the shared
   caps public/style.css sets — so a date box in this panel filled all 340px
   instead of holding a date's worth of space. `width: 100%` stays: it is the
   measured fix above and the caps are ceilings, so a name field still fills the
   column and a date field now stops when it has enough. */
.preview-panel .pv-edit-form input:not([type="checkbox"]):not([type="radio"]),
.preview-panel .pv-edit-form select,
.preview-panel .pv-edit-form textarea { width: 100%; }
/* The form's own submit keeps its own words and its own drawing; in this column
   it simply fills the width, the way the panel's other primary does. */
.preview-panel .pv-edit-form button[type="submit"] { width: 100%; }
/* The duplicate-number warning the contact form draws, carried in with the form
   so the reader is told who already holds that number in the server's own
   words. It keeps `.warn`'s own look from public/style.css. */
.preview-panel .pv-edit-form .warn { margin: 0 0 var(--space-sm); }

/* ---- THE WAY OUT OF THE FORM WITHOUT CHANGING ANYTHING ------------------- */
/* It is the SECONDARY, under the save rather than beside it: in a 340px column
   two buttons in a row leave neither wide enough to read, and the one that is
   pressed by mistake should not be the one that throws the answers away. */
.preview-panel .pv-edit-foot { margin: var(--space-md) 0 0; }
.preview-panel .pv-cancel {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0.5rem 0.9rem;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.preview-panel .pv-cancel:hover {
  background: var(--paper-2);
  border-color: var(--faint);
  color: var(--ink);
}

/* ONE GROUP IS ONE THING A PERSON CHANGES — its label, its control, whatever
   second answer it needs, and its own Save. Two groups are separated by space
   and nothing else: a second rule inside a 340px column would read as a second
   section of the panel. */
.preview-panel .pv-edit-group + .pv-edit-group,
.preview-panel .pv-edit-action + .pv-edit-group,
.preview-panel .pv-edit-group + .pv-edit-action {
  margin-top: var(--space-md);
}

/* Label above control, for the reason the facts are label-above-value: in this
   width a label beside a select leaves the select too narrow to read a name in. */
.preview-panel .pv-edit-row {
  display: block;
  margin: 0 0 var(--space-xs);
}
/* THE LABEL TAKES THE HOUSE INK, NOT THE HELPER GREY. It was --t3 — the same
   colour as `.pv-edit-hint` two rules down, so in this panel the question and
   the note under it were drawn identically. public/style.css moved a label to
   --t1 on 17 September for exactly that reason, and the word here is inside the
   <label> that rule paints, so dropping the colour is the whole of the change:
   it inherits --t1 and the 600 weight from the row it sits in. */
.preview-panel .pv-edit-label {
  display: block;
  margin: 0 0 var(--space-xxs);
  font-size: var(--fs-caption);
  line-height: 1.43;
  letter-spacing: var(--ls-caption);
}
/* Same removal, same reason as the rule above: the cap is the shared one. */
.preview-panel .pv-edit-input { width: 100%; }

/* The sentence under a control that has a condition on it — the record page's
   own words, in the record page's own quiet grey. */
.preview-panel .pv-edit-hint {
  margin: calc(-1 * var(--space-xxs)) 0 var(--space-xs);
  font-size: var(--fs-caption);
  line-height: 1.43;
  letter-spacing: var(--ls-caption);
  color: var(--t3);
}

/* Save fills its group. It is the primary of that group and there is only ever
   one thing it can do, so nothing sits beside it to share the width with. */
.preview-panel .pv-save { width: 100%; }

/* A MOVE THAT NEEDS NO CHOICE FIRST — "Mark Contacted". It is a secondary
   button, in `.pv-act`'s own box, because it is one press with no composing:
   drawing it as a primary would put two blue buttons in a 340px column and make
   the reader work out which one is the thing they came for. */
.preview-panel .pv-edit-action {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0.5rem 0.9rem;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.preview-panel .pv-edit-action:hover {
  background: var(--paper-2);
  border-color: var(--faint);
  color: var(--ink);
}

/* WHAT HAPPENED, SAID ONCE, UNDER THE THING IT HAPPENED TO. It holds no height
   while it is empty, so a panel nobody has saved from is exactly as tall as it
   was before this block existed. */
.preview-panel .pv-edit-msg {
  margin: var(--space-sm) 0 0;
  font-size: var(--fs-caption);
  line-height: 1.43;
  letter-spacing: var(--ls-caption);
  color: var(--t3);
}
.preview-panel .pv-edit-msg:empty { display: none; }
/* A REFUSAL READS AS A REFUSAL. The record pages draw theirs in the danger ink
   (public/style.css `.error`), and a sentence lifted out of one of them and
   shown in the panel's quiet grey would be the same words in a tone that says
   nothing is wrong. Colour only: the block, the size and the place are the
   same, because this is the same line saying a different thing. */
.preview-panel .pv-edit-msg.is-bad { color: var(--danger); font-weight: 600; }

/* ---- the way in ---------------------------------------------------------- */
/* TWO BUTTONS SIDE BY SIDE, AND THE GESTURE UNDER THEM.
   KEITH, 29 August 2026, on what was here: "the 'log activity' placed weirdly
   and it's in a box with hyperlink? don't think that is correct." It was an <a>
   wearing `.btn-inline` — a 24px box round accent-coloured, underlined link
   text — hanging beneath the full-width Open record button. Two actions of the
   same kind were drawn as a button and as a link in a box.
   They are two BUTTONS now, in one row: Open record carries the accent because
   it is the primary, Log Activity is the secondary beside it. */
/* AND THE ACTION SITS BOTTOM RIGHT.
   It sat bottom LEFT from 4 September 2026 — "And make sure the action button is
   on the left bottom corner. think of are like that when in this setting." —
   and KEITH RETIRED THAT RULE: "retire old rule. Left corner is only when it
   make sense. but by default it shoul dbe Right bottom corner."
   All thirteen shared panels were still on the retired rule while Account
   Health's own panel followed the new one, so two quick views in SGE visibly
   disagreed about which corner an action stands in
   (docs/2026-09-12-quick-view-fields-audit.html, section 8). They agree now, and
   they agree on the rule that is current. The buttons still take their own width
   rather than stretching to fill the row — that half of the 4 September change
   was about a primary marooned in the middle of nothing, and it stands. */
.preview-panel .pv-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin: var(--space-lg) 0 0;
  padding: var(--space-md) 0 0;
  border-top: 1px solid var(--line-soft);
}
/* AND IT IS NOT DRAWN WHILE THE PANEL IS A FORM. Open record and Log Activity
   are the two ways to LEAVE this record; offering them beside a form holding
   answers nobody has saved yet is offering to throw those answers away. A
   `display: flex` box ignores `hidden` unless it is told, which is the same
   fact `.pv-act[hidden]` below is already stated for. */
.preview-panel .pv-foot[hidden] { display: none; }

/* =====================================================================
   THE WEEKLY REVIEW'S THREE BUTTONS ARE ONE GROUP — 3 October 2026.

   KEITH, 3 October 2026 at 16:38: "Click the row, the Quick view panel will
   open which will allow the comments to be written straight into the quick view
   panels. Then reviewer click on 'Send to Sales Person' , 'Nothing Needed' and
   'Open Record'". Three actions on ONE decision.

   WHAT WAS WRONG. They inherited the row above — wrap, right-aligned, each
   button its own width — and the three labels add up to about 440px in a panel
   whose content column is 308px (--preview-w is 340px, less --space-md either
   side), so they can never share a line. What was drawn was "Send to Sales
   Person" alone on the first line and the other two on a second, their left
   edges landing wherever the right-alignment left them: three buttons reading as
   one stray and a pair, photographed at desk width on 3 October 2026
   (/Users/keith/Vault/Attachments/SGE/2026-10-03-weekly-review-panel.png).

   ONE COLUMN, SAME WIDTH, SAME ORDER, AT EVERY PANEL WIDTH. The panel's content
   column is the only width in play — 308px at desk and iPad, the handset's own
   width on a phone — and no arrangement of these three labels fits a line at any
   of them. So they are stacked: every edge flush with every other, the primary
   first, and the group looks the same whatever the window does. Nothing is
   clipped and no label wraps, which is what a row of three in 308px would cost
   ("Send to Sales Person" was clipped to "on" when they were made to share one).

   THE LABELS ARE NOT TOUCHED. "Send to Sales Person", "Nothing Needed" and
   "Open Record" are Keith's own spelling and they ship as written
   (src/decisions/vocabulary.js, src/review/vocabulary.js panelOpenRecord).

   IT IS THIS ONE BLOCK AND NOTHING ELSE. `.review-decide-actions` is the class
   src/review/render.js cardActionsOf stamps on the Weekly review's own foot; the
   shared `.pv-foot` above is untouched, so Open record and Log Activity on
   /customers, /contacts and every other list stand exactly where they stood.
   ===================================================================== */
.preview-panel .pv-foot.review-decide-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
}
/* AND `hidden` STILL MEANS HIDDEN. The shared `.pv-foot[hidden]` rule above is
   one class less specific than this block's, so without this line a grid box
   told to hide would have gone on being drawn — the same fact that rule itself
   is stated for, restated at the specificity this one has. */
.preview-panel .pv-foot.review-decide-actions[hidden] { display: none; }
/* AND ONE GAP BETWEEN THEM, NOT TWO DIFFERENT ONES. The block is a <form>, so
   `.manage-form button[type="submit"] { margin-top: 0.6rem }` (public/style.css)
   was reaching the two decision buttons and leaving 17px above each of them and
   8px above the Open Record link — measured at 1440px before this line. That
   margin is for a submit standing under a form's fields, which is not what these
   are: they are the foot's own row, and the foot already states the gap. */
.preview-panel .pv-foot.review-decide-actions > button[type="submit"] { margin-top: 0; }
/* IT TAKES THE WIDTH OF ITS OWN LABEL and stands at the right of the foot —
   Keith's bottom-right default, above. `min-width` keeps it a real target at the
   44px floor whatever the label says. */
.preview-panel .pv-open { flex: 0 0 auto; width: auto; min-width: 8rem; }

/* …AND IT IS NOT DRAWN AT ALL WHERE THERE IS NO RECORD TO OPEN — /contacts,
   whose rows are a preview and nothing else because SGE has no /contacts/:id
   screen (public/list-preview.js sets `hidden` on both). `hidden` on a flex
   ITEM is otherwise ignored, which is the same fact `.pv-act[hidden]` below is
   already stated for, and it is why the button was still on screen: the panel
   had hidden it and the layout drew it anyway. Nothing here reaches a panel
   whose record CAN be opened.

   THE LINE THAT USED TO BE HIDDEN BESIDE IT IS GONE — Keith, 4 September 2026,
   on "Double-click to open it.": "ok drop it". It is no longer drawn on any
   panel, so there is nothing left to hide. */
.preview-panel .pv-open[hidden] { display: none; }

/* ---- A FORM IN THE PANEL ------------------------------------------------- */
/* KEITH, 30 August 2026, on the queue of projects the CRM could not place:
   "For this.. I think it's too big for a card. Do we need to selec the
   contact?" — and, on a list whose quick view carries the two answers: "okie Go
   ahead with this proposal. for both".

   So one screen's panel holds a form as well as facts. The form is the PAGE'S
   own server-rendered markup, moved in by public/project-attach.js — this file
   only gives it the width of the panel and a rule off the facts above it. Its
   own type, spacing and colours are in public/style.css (`.atp-*`), because the
   same form is drawn on the project's record page where there is no panel.

   The panel is a column and can scroll, so a form at the foot of it is reached
   the way the facts are. Nothing here is drawn below 1280px: there is no panel
   at those widths, and the attach is done on the record page instead. */
.preview-panel .atp-form {
  margin: var(--space-lg) 0 0;
  padding: var(--space-md) 0 0;
  border-top: 1px solid var(--line-soft);
}
.preview-panel .atp-form select { max-width: 100%; }

/* THE SECONDARY, AND NOT A LINK. Its box is `.review-btn`'s — the one secondary
   button SGE already draws at the 44px floor (public/style.css) — so no new
   colour, size or radius is introduced here. `text-decoration: none` is stated
   rather than assumed: this is an <a>, and the document's anchor rule underlines
   it, which is the underline Keith was looking at.

   IT STILL CARRIES THE ACCOUNT THROUGH. The href is the server's
   (src/preview.js) and is unchanged — /visits/new?customer_id=… — which is
   Keith's standing rule that Log Activity started from the preview arrives with
   the account details already filled in. Only the drawing changed. */
.preview-panel .pv-act {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: var(--tap);
  padding: 0.5rem 0.9rem;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
}
.preview-panel .pv-act:hover {
  background: var(--paper-2);
  border-color: var(--faint);
  color: var(--ink);
  text-decoration: none;
}
/* `hidden` on an element the flex container lays out is otherwise ignored — the
   panel hides this the instant it changes record, and a record type with no
   action of its own must not leave an empty box in the row. */
.preview-panel .pv-act[hidden] { display: none; }
/* THE GESTURE IS NO LONGER SAID IN WORDS. `.pv-hint` — "Double-click to open
   it." — carried a line of its own under the two buttons; Keith dropped it on
   4 September 2026 ("ok drop it") because Open record, directly above it, is
   the same instruction as a control. The class is not drawn by any file now, so
   there is no rule for it. The gesture itself is unchanged
   (public/row-click.js). */

/* ---- the row the panel is showing ---------------------------------------- */
/* WHICH ROW AM I LOOKING AT. Without this the panel is a floating card with no
   stated subject the moment the reader's eye leaves it. It is the accent's own
   wash — the same fill every other SELECTED thing in SGE takes (the open menu
   entry, the chosen calendar day, the nav item you are on), so selection reads
   as selection and nothing new is introduced.

   It is a BACKGROUND, which is deliberate: `is-opened` — the row a manager has
   already been into — is a TEXT colour, so a row can be both at once and
   neither repaints the other. The selector out-weighs `tbody tr:hover td` so
   the mark survives the pointer passing over a different row. */
table.cardlist > tbody > tr[data-row-href].is-previewing > td {
  background: var(--accent-soft);
}
table.cardlist > tbody > tr[data-row-href].is-previewing > td:first-child {
  box-shadow: inset 2px 0 0 0 var(--accent);
}
