/*
 * Spec 0208 v5.1 §6.1 (row 0208): the merchant portal, rebuilt by hand as classes to the operator's Final v2 desktop
 * design (docs/plans/2026-10-28-portal-design-final-v2/). As built: a 56px header on the dark canvas; the white sheet
 * 10px in from the window's sides and bottom, with 14px corners; one wrapping toolbar row of 36px pills; 54px rows and
 * no footer (the time zone is named in the Created head); the 440px drawer docked beside the sheet; the sign-in
 * as one pill over the card cloud (#305). Where the spec and the design differ, the spec decides (§6.1).
 *
 * Every colour is a custom property on :root; the rest of the file uses var() only
 * (tests/unit/portal/portal-client.test.ts, AC-0208-14). --color-decor colours
 * decoration (separators, disabled chevrons, the dashed Test outline, the skeleton),
 * never text. The page is light only: there is no dark set until slice 2c designs one (spec 0208 §6.1–§6.2).
 *
 * It stays inside the portal CSP and the compatibility floor enforced by
 * tests/lints/hosted-page-css.test.ts: no :has(), nesting, container queries,
 * color-mix(), @layer, subgrid, backdrop-filter, text-wrap, flex/grid gap (margins
 * instead), and no url() that is not a data: URI. Icons are the inline SVG sprite in
 * portal.html, stroked with currentColor; the sign-in ledger's flags are cells of the
 * one flag image that sprite references.
 */

:root {
  color-scheme: light;
  /* The black canvas behind the header and the sign-in, under the grain (spec 0208 v5.6, D7: black replaced navy; the two
     stops stay, so the body's gradient rule is unchanged). */
  --color-canvas-top: #000000;
  --color-canvas-bottom: #000000;
  --color-on-canvas: #E7EBF1;
  --color-on-canvas-muted: #C9D3E3;
  --color-on-canvas-subtle: #AEB9CB;
  --color-on-canvas-pill: #DCE3EE;
  --color-on-canvas-key: #8B95A6;
  --color-nav-active: rgba(255, 255, 255, 0.10);
  --color-nav-hover: rgba(255, 255, 255, 0.06);
  --color-nav-text-active: #FFFFFF;
  --color-chrome-hover: rgba(255, 255, 255, 0.08);
  --color-chrome-control: rgba(255, 255, 255, 0.08);
  --color-chrome-focus: #8DB4F0;
  --color-card-shadow: rgba(0, 0, 0, 0.6);
  /* The white card and what sits on it. */
  --color-surface: #FFFFFF;
  --color-segment: #F2F4F7;
  --color-text: #0F1729;
  --color-text-soft: #465264;
  --color-text-muted: #5D6778;
  --color-text-head: #5D6778;
  --color-icon: #7D879A;
  --color-border: #E3E7ED;
  --color-border-strong: #CBD2DC;
  --color-drawer-border: #DCE1E8;
  --color-code-bg: #F6F7F9;
  --color-qr-light: #FFFFFF; /* the setup QR code's ground and modules: black on white whatever the theme, as scanners need (spec 0312 §3.5) */
  --color-qr-dark: #000000;
  --color-divider: #EEF0F3;
  /* The card brand's frame in the drawer's Card row (issue #376): white whatever the drawer's ground, so a brand's colours read on it. */
  --color-brand-frame-bg: #FFFFFF;
  --color-brand-frame-border: #D9D9DE;
  /* the open row: a neutral grey below the hover grey and the accent bar at its left edge; never amber, which means attention (spec 0208 v5.2 §6.2) */
  --color-row-selected: #EEF0F3;
  --color-row-selected-bar: #2457A6;
  --color-row-hover: #F6F7F9;
  --color-attention-tint: #FFFBEB;
  --color-accent: #2457A6;
  --color-accent-hover: #1D4A8E;
  --color-focus-ring: #ECF2FB;
  --color-button: #0B1220;
  --color-on-button: #FFFFFF;
  --color-primary-top: #3069C2;
  --color-primary-bottom: #2457A6;
  --color-primary-edge: rgba(255, 255, 255, 0.22);
  --color-primary-shadow: rgba(11, 18, 32, 0.25);
  --color-segment-shadow: rgba(11, 18, 32, 0.12);
  --color-pop-shadow: rgba(11, 18, 32, 0.18);
  --color-error: #B42318;
  --color-error-strong: #8F1D14;
  --color-error-bg: #FDEEEC;
  --color-error-on-canvas: #F97066;
  --color-banner-hover: rgba(255, 255, 255, 0.6);
  --color-notice-bg: #EAF1FB;
  --color-notice-text: #1D4A8E;
  --color-dot-paid: #1F9D57;
  --color-dot-failed: #D92D20;
  --color-dot-progress: #2457A6;
  --color-dot-attention: #D08A00;
  --color-attention-text: #7A4A00;
  --color-attention-on-dark: #F2C14E;
  --color-paid-text: #146C3C;
  --color-failed-text: #B42318;
  --color-progress-text: #2457A6;
  --color-decor: #B4BAC4;
  --color-rail: #DADFE6;
  --color-skeleton: #EEF0F3;
  --color-skeleton-hi: #F6F7F9;
  --color-mono: #0F1729;
  --color-copied-bg: #EAF6EF;
  --color-copied-text: #146C3C;
  /* The sign-in cloud (spec 0208 v5.6 §6.2): read once by portal.js and drawn on its canvases, never styled. */
  --color-cloud-ink: #E6EBF3;
  --color-cloud-mid: #7FA6E6;
  --color-cloud-chip: #F2B82B;
  /* The grain over the dark canvas: a 16px ordered dither of these sixteen translucent tints, dark and light (the pt-grain pattern
     in portal.html, one path per tint). On black the dark tints vanish, so the light specks (10-16) carry the texture; #301 doubled
     their opacity so a laptop panel shows them (operator's option B, 2026-11-02). */
  --color-grain-1: rgba(1, 1, 0, 0.8);
  --color-grain-2: rgba(2, 0, 6, 0.333);
  --color-grain-3: rgba(0, 0, 30, 0.749);
  --color-grain-4: rgba(2, 0, 18, 0.333);
  --color-grain-5: rgba(0, 12, 4, 0.275);
  --color-grain-6: rgba(0, 12, 19, 0.275);
  --color-grain-7: rgba(16, 12, 0, 0.2);
  --color-grain-8: rgba(251, 12, 255, 0.004);
  --color-grain-9: rgba(0, 31, 30, 0.725);
  --color-grain-10: rgba(255, 237, 203, 0.11);
  --color-grain-11: rgba(255, 237, 221, 0.11);
  --color-grain-12: rgba(254, 255, 202, 0.11);
  --color-grain-13: rgba(254, 255, 221, 0.11);
  --color-grain-14: rgba(255, 239, 189, 0.118);
  --color-grain-15: rgba(255, 239, 207, 0.118);
  --color-grain-16: rgba(255, 240, 194, 0.126);
}

/* ---- Base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--color-canvas-bottom);
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, var(--color-canvas-top) 0%, var(--color-canvas-bottom) 120px);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

p {
  margin: 0;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.pt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Rendered at no size, never display: none: the grain's <pattern> lives here and is painted from other SVGs, and a paint server
   inside an undisplayed SVG may not render (portal-client.test.ts pins it). */
.pt-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.pt-icon {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pt-noscript {
  padding: 24px;
  color: var(--color-on-canvas);
}

.pt-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  font-weight: 500;
  cursor: pointer;
}

.pt-link:hover {
  color: var(--color-accent-hover);
}

.pt-link:disabled {
  color: var(--color-text-muted);
  cursor: default;
}

/* The empty and error states' button (Final v2 page.html 257, 263): a 36px pill with a 1px rule, as Load more is. */
.pt-button {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: none;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pt-button:hover {
  background: var(--color-row-hover);
}

/* Every ring drawn with a box-shadow keeps a transparent outline: forced-colors mode (Windows High Contrast) drops the shadow and
   paints the outline in a system colour, so focus still shows there. `outline: none` would leave nothing. */
.pt-button:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent);
}

/* ---- Sign-in (and the loading view) on the dark canvas -------------------- */

/* The canvas both views share (Final v2 page.html 55). The loading view centres its one line; the sign-in's cloud is placed over
   it, and #pt-signin-form centres the card. Hidden overflow keeps the dropping form from scrolling the page. There is no 900px
   floor (ruling P2b-R6): until slice 2c the narrow sign-in is the provisional one, and the cloud fills whatever size there is. */
.pt-signin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-canvas-top) 0%, var(--color-canvas-bottom) 120px);
}

/* The grain on the dark canvas, the first child of the loading, sign-in and app views and under everything else in them: an inline
   SVG filled with the pt-grain pattern of portal.html's sprite. A pattern,
   not a background image: the portal CSP allows no data: image and the CSS lint no other url(). Each pixel of the 16px tile is
   one CSS pixel, drawn edge to edge so it stays sharp at every device pixel ratio. */
.pt-grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pt-grain-1 { fill: var(--color-grain-1); }
.pt-grain-2 { fill: var(--color-grain-2); }
.pt-grain-3 { fill: var(--color-grain-3); }
.pt-grain-4 { fill: var(--color-grain-4); }
.pt-grain-5 { fill: var(--color-grain-5); }
.pt-grain-6 { fill: var(--color-grain-6); }
.pt-grain-7 { fill: var(--color-grain-7); }
.pt-grain-8 { fill: var(--color-grain-8); }
.pt-grain-9 { fill: var(--color-grain-9); }
.pt-grain-10 { fill: var(--color-grain-10); }
.pt-grain-11 { fill: var(--color-grain-11); }
.pt-grain-12 { fill: var(--color-grain-12); }
.pt-grain-13 { fill: var(--color-grain-13); }
.pt-grain-14 { fill: var(--color-grain-14); }
.pt-grain-15 { fill: var(--color-grain-15); }
.pt-grain-16 { fill: var(--color-grain-16); }

/* The part of the sign-in that drops away in the startle exit (.pt-exiting): the stack, centred. The 24px above and
   below are the old canvas padding, for a stack taller than the window (the enrolment card). */
.pt-signin-form {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 24px 20px;
  transition: opacity 0.45s, transform 0.6s cubic-bezier(.4, 0, .6, 1);
}

.pt-loading-text {
  position: relative;
  color: var(--color-on-canvas-muted);
}

/* #305 (design 4a, "one control"): each step is a quiet context line, the pill and a foot, stacked and centred, and every step keeps
   this shape. The stack is #pt-signin-form's first child: the startle exit's centre, and the region where a click adds no card. */
.pt-signin-stack {
  width: 400px;
  max-width: 100%;
}

.pt-signin-step {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The floor has no flex gap: each part of a step after the first sits 14px under the one before. */
.pt-signin-step > * + * {
  margin-top: 14px;
}

.pt-signin-line {
  margin: 0;
  color: var(--color-on-canvas-muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  text-align: center;
}

.pt-signin-line strong {
  color: var(--color-on-canvas);
  font-weight: 500;
}

/* The pill is the field: one white control holding the input and the button. It rings as a field does when either has focus; the
   input draws no ring of its own inside it. A refused entry (markField sets .pt-signin-pill-invalid beside aria-invalid) rings it red. */
.pt-signin-pill {
  display: flex;
  align-items: center;
  width: 100%;
  height: 56px;
  padding: 6px 6px 6px 22px;
  border-radius: 28px;
  background: var(--color-surface);
  box-shadow: 0 40px 80px -24px var(--color-card-shadow);
}

.pt-signin-pill:focus-within {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--color-focus-ring), 0 40px 80px -24px var(--color-card-shadow);
}

.pt-signin-pill.pt-signin-pill-invalid {
  box-shadow: inset 0 0 0 1px var(--color-error), 0 40px 80px -24px var(--color-card-shadow);
}

.pt-signin-pill.pt-signin-pill-invalid:focus-within {
  box-shadow: inset 0 0 0 1px var(--color-error), 0 0 0 3px var(--color-focus-ring), 0 40px 80px -24px var(--color-card-shadow);
}

.pt-input,
.pt-code {
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-text);
}

.pt-input {
  font-size: 15px;
}

/* One real input per step, for assistive technology, one-time-code autofill and paste; its spacing makes six digits read as six boxes would. */
.pt-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 0.45em;
}

/* The pill shows the focus; the transparent outline is what forced-colors mode paints. */
.pt-input:focus,
.pt-code:focus {
  outline: 2px solid transparent;
}

.pt-primary {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 44px;
  margin: 0 0 0 6px;
  padding: 0 24px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--color-primary-top) 0%, var(--color-primary-bottom) 100%);
  box-shadow: inset 0 1px 0 var(--color-primary-edge), 0 1px 2px var(--color-primary-shadow);
  color: var(--color-on-button);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pt-primary:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent);
}

.pt-primary:disabled {
  opacity: 0.7;
  cursor: default;
}

@media (max-width: 359px) {
  .pt-primary {
    padding: 0 18px;
  }
}

/* Under the pill: the error, the session-ended notice, the step's links and the lost-device note, on the canvas. An empty foot keeps
   its one line, so the pill does not move between steps. */
.pt-signin-foot {
  min-height: 18px;
  color: var(--color-on-canvas-subtle);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pt-signin-links {
  margin: 0;
}

/* Between the shown links only: a hidden one before a shown one would push it off centre (#543). */
.pt-signin-links > :not([hidden]) ~ :not([hidden]) {
  margin-left: 16px;
}

/* The setup page's two links are anchors: they read as the sign-in's link buttons do, underlined on hover only (#543). */
.pt-signin-foot .pt-link {
  color: var(--color-chrome-focus);
  font-size: 12px;
  text-decoration: none;
}

.pt-signin-foot .pt-link:hover {
  color: var(--color-chrome-focus);
  text-decoration: underline;
}

/* The resend countdown is text until it runs out; then it is the link. */
.pt-signin-foot .pt-link:disabled {
  color: var(--color-on-canvas-subtle);
  font-weight: 400;
  text-decoration: none;
}

/* --color-error is too dark to read on the canvas; its on-canvas red is the operator's (#305). */
.pt-signin-error {
  margin: 0;
  color: var(--color-error-on-canvas);
}

.pt-notice {
  margin: 0;
  color: var(--color-on-canvas-muted);
}

.pt-lost-note {
  margin: 4px 0 0;
  color: var(--color-on-canvas-muted);
}

/* The staff setup step (spec 0484 §3.12, #543): design 4a's shape with a sentence for its control. The card is the pill's white
   surface, radius and shadow, grown to hold the step's sentence and its one button, which sits at the card's end as the pill's does. */
.pt-signin-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 20px 20px 20px 24px;
  border-radius: 28px;
  background: var(--color-surface);
  box-shadow: 0 40px 80px -24px var(--color-card-shadow);
  color: var(--color-text);
}

.pt-signin-card-text {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
}

/* The gap above the button is the button's own: a view with no button leaves an empty row of no height and no margin. */
.pt-signin-card-actions {
  display: flex;
  justify-content: flex-end;
}

.pt-signin-card-actions > .pt-primary {
  margin: 16px 0 0;
}

/* Authenticator enrolment is not in design 4a: it keeps a white card, above the pill, until it is designed (#305). */
.pt-card {
  width: 100%;
  padding: 20px 24px;
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: 0 40px 80px -24px var(--color-card-shadow);
  color: var(--color-text);
  font-size: 14px;
  line-height: 20px;
}

.pt-lede {
  margin: 0;
  color: var(--color-text-soft);
}

.pt-label {
  display: block;
  margin-top: 12px;
  color: var(--color-text-soft);
  font-size: 13px;
  font-weight: 500;
}

.pt-secret {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
  color: var(--color-mono);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.pt-uri {
  font-size: 12px;
  letter-spacing: 0;
}

/* ---- The sign-in cloud (spec 0208 v5.6 §6.2) ----

   Decoration: portal.js draws a flock of payment cards, from portal-cloud.js, only as recoloured grain pixels on two aria-hidden
   canvases over the grain and under the form: #pt-cloud moves (WebGL), #pt-cloud-still is the still frame (reduced motion, no GPU).
   Each canvas pixel is one CSS pixel, scaled without smoothing, so it lands on one pixel of the grain at every device pixel ratio. */
.pt-cloud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

/* The startle exit: while the flock flies off, the form drops away (beginExit adds the class). The reduce block turns the
   transition off, and under reduced motion there is no exit: the app appears at once. */
.pt-exiting .pt-signin-form {
  opacity: 0;
  transform: translateY(4%) scale(0.97);
  pointer-events: none;
}

/* Text for assistive technology only: the sign-in's "Signed in as …" status (ruling P2b-R30). */
.pt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- App frame: the header on the canvas, the white card below it -------- */

.pt-app {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
}

/* Above the sheet, as Final v2's header is (page.html 137: relative, z-index 1): the sheet is out of flow now, so the stacking order is stated. */
.pt-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  color: var(--color-on-canvas);
}

.pt-header-id,
.pt-header-user {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* The right group never shrinks (its buttons would spill into the page padding): the merchant's name on the left gives way instead. */
.pt-header-user {
  flex: none;
  margin-left: 16px;
}

/*
 * The signed-in merchant's name. Staff have none: they pick a merchant (the picker) instead. When the header runs out of
 * room this is what gives way, and ends in an ellipsis (labels run to 200 characters): everything else keeps its size.
 */
.pt-brand {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--color-on-canvas-muted);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-brand:empty {
  display: none;
}

/* The staff's merchant picker: a pill on the canvas, the native select lying over it as it does over the chips. It may shrink, its
   value ending in an ellipsis, so in a narrow header it gives way instead of running into the Staff pill. */
.pt-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 280px;
  height: 32px;
  padding: 0 30px 0 12px;
  border-radius: 16px;
  background: var(--color-chrome-control);
  color: var(--color-on-canvas);
  white-space: nowrap;
  cursor: pointer;
}

.pt-picker-key {
  margin-right: 6px;
  color: var(--color-on-canvas-key);
}

.pt-picker-value {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-picker-chevron {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--color-on-canvas-key);
}

.pt-picker:hover {
  background: var(--color-chrome-hover);
}

.pt-picker:focus-within {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--color-canvas-bottom), 0 0 0 4px var(--color-chrome-focus);
}

.pt-nav {
  display: flex;
  flex: none;
  align-items: center;
  margin-left: 20px;
}

.pt-nav-item {
  display: flex;
  align-items: center;
  height: 32px;
  margin-right: 2px;
  padding: 0 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--color-on-canvas-subtle);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.pt-nav-item[aria-current="page"] {
  background: var(--color-nav-active);
  color: var(--color-nav-text-active);
  font-weight: 600;
}

.pt-nav-item:hover {
  background: var(--color-nav-hover);
  color: var(--color-nav-text-active);
}

.pt-who {
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  color: var(--color-on-canvas-subtle);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-role {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 22px;
  margin-left: 12px;
  padding: 0 9px;
  border-radius: 11px;
  background: var(--color-chrome-control);
  color: var(--color-on-canvas-pill);
  font-size: 11.5px;
  font-weight: 600;
}

.pt-ghost {
  flex: none;
  height: 32px;
  margin-left: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-on-canvas-muted);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.pt-ghost:hover {
  background: var(--color-chrome-control);
  color: var(--color-nav-text-active);
}

/* One ring for the controls on the canvas: a gap in the canvas's own colour, then the ring. */
.pt-nav-item:focus-visible,
.pt-ghost:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--color-canvas-bottom), 0 0 0 4px var(--color-chrome-focus);
}

/* The sheet: a white card under the header with a 10px inset (Final v2 page.html 413). It is placed, not laid out, so the
   open drawer can dock beside it: its right edge moves to the drawer's width plus the 10px inset from the window's (450px at the
   default 440px; the drawer's 1px border lies over the sheet's last pixel) and its right corners square off against the drawer's. */
.pt-frame {
  position: absolute;
  top: 56px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: var(--color-surface);
}

.pt-drawer-open .pt-frame {
  right: calc(var(--pt-drawer-width, 440px) + 10px);
  border-radius: 14px 0 0 14px;
}

/* The sheet shows one page at a time (Payments or Settings). In the frame's column it may shrink below its content: the list scrolls inside it. */
.pt-page {
  flex: 1;
  min-height: 0;
}

.pt-list {
  display: flex;
  flex-direction: column;
}

.pt-page-pad {
  padding: 28px 32px;
}

/* ---- Get started (spec 0286 §3.1, §3.3; a Settings sub-page since v0.9, issue #293; v0.10's checklist, #309): the choice as a
   switch over a preview of the five steps, or a path's checklist with its progress over it and its links under it ---- */

/* The badge beside Get started in Settings' nav: the chosen path's steps done out of 5. The header tab's pill, in the sheet's colours. */
.pt-settings-badge {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--color-border);
  color: var(--color-text-soft);
  font-size: 11.5px;
  line-height: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pt-start-note {
  margin: 0;
  color: var(--color-text-muted);
}

/* The choice: "Your store runs on" beside the switch, the preview, then Start step 1 and the guide. */
.pt-start-runs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.pt-start-runs-key {
  font-weight: 600;
}

.pt-start-preview {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  list-style: none;
  counter-reset: pt-preview;
}

.pt-start-preview > li {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--color-divider);
  counter-increment: pt-preview;
}

.pt-start-preview > li:first-child {
  border-top: 0;
}

.pt-start-preview-n {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.pt-start-preview-n::before {
  content: counter(pt-preview);
}

.pt-start-preview-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.pt-start-preview-time {
  flex: none;
  color: var(--color-text-muted);
}

.pt-start-begin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
}

/* A path: its title and "{n} of 5 done", the five-part bar under them. */
.pt-start-head {
  display: flex;
  flex-direction: column;
}

.pt-start-head-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
}

.pt-start-count {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.pt-start-bar {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-start-bar > li {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--color-divider);
}

.pt-start-bar > li.pt-on {
  background: var(--color-dot-paid);
}

.pt-start-live {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--color-copied-bg);
}

.pt-start-live p {
  margin: 0;
}

.pt-start-live-h {
  color: var(--color-copied-text);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}



/* The steps, numbered by a counter so the markup holds no number; a done step's number gives way to a check. A done step and a
   future one are each one line; only the current step opens, as a card. min-width: 0 lets the list shrink below its widest line,
   so step 2's command scrolls inside its own box instead of widening the page. */
.pt-start-steps {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pt-step;
}

.pt-step {
  counter-increment: pt-step;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.pt-step-line {
  display: flex;
  align-items: center;
}

.pt-step-mark {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--color-border-strong);
  border-radius: 11px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.pt-step-mark::before {
  content: counter(pt-step);
}

.pt-step-mark .pt-icon {
  display: none;
  width: 14px;
  height: 14px;
}

.pt-step-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}

.pt-step-proof {
  flex: none;
  color: var(--color-text-muted);
}

.pt-step-body {
  display: none;
}

.pt-step-done {
  color: var(--color-text-soft);
}

.pt-step-done .pt-step-mark {
  border-color: var(--color-copied-bg);
  background: var(--color-copied-bg);
  color: var(--color-copied-text);
}

.pt-step-done .pt-step-mark::before {
  content: none;
}

.pt-step-done .pt-step-mark .pt-icon {
  display: block;
}

.pt-step-future {
  color: var(--color-text-muted);
}

.pt-step-future.pt-step-open {
  color: var(--color-text);
}

/* A step's own instructions (#317): one column, each instruction tight above its button and a wider gap before the next one; the
   test card with its copy button, the key panel when the step opens it, and the step's fixes folded under "Something wrong?". */
.pt-step-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

/* Spec 0329 §3.7: one row per test card, its label then its number; under the rows, one expiry date and CVC for any of them (#460). */
.pt-step-card-row {
  display: flex;
  flex-wrap: wrap;
  flex-basis: 100%;
  align-items: center;
}

.pt-step-card-row + .pt-step-card-row {
  margin-top: 2px;
}

.pt-step-card-label {
  margin-right: 12px;
  font-weight: 500;
}

.pt-step-card-row + .pt-step-card-details {
  margin-top: 4px;
}

/* #460: a label and its value wrap as one, so a narrow card never leaves "CVC" on one line and its digits on the next. */
.pt-step-card-detail {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.pt-step-keyslot:empty {
  display: none;
}

.pt-step-trouble > summary {
  color: var(--color-text-soft);
  font-weight: 500;
  cursor: pointer;
}

.pt-step-trouble > .pt-step-card {
  margin-top: 8px;
}

.pt-step-trouble > ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--color-text-soft);
}

.pt-step-trouble > ul > li + li {
  margin-top: 6px;
}

.pt-step-open .pt-step-body > .pt-step-text + .pt-step-actions:not([hidden]) {
  margin-top: 8px;
}

.pt-step-open .pt-step-body > .pt-step-actions + .pt-step-text:not([hidden]) {
  margin-top: 20px;
}

/* Any step opens by its title (#317), the current one by default: the open step is the one card, with its words, its actions and
   the guide link, indented under the title. The current step's mark keeps the accent, so where you are shows when another is open. */
.pt-step-toggle {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pt-step:not(.pt-step-open) .pt-step-toggle:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.pt-step-open {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border-color: var(--color-border-strong);
  box-shadow: 0 1px 2px var(--color-segment-shadow);
}

.pt-step-current .pt-step-mark {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pt-step-open .pt-step-title {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}

.pt-step-open .pt-step-body {
  display: flex;
  flex-direction: column;
  margin-left: 34px;
}

.pt-step-body p,
.pt-step-body ul {
  margin: 0;
}

.pt-step-text {
  color: var(--color-text-soft);
}

.pt-step-text strong {
  color: var(--color-text);
  font-weight: 600;
}

.pt-step-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.pt-step-action {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.pt-start-switch,
.pt-step-link {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.pt-start-switch:hover,
.pt-step-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* The waiting line: a step that ticks from something done elsewhere, with Check again at its end. */
.pt-step-wait {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-notice-bg);
  color: var(--color-notice-text);
}

.pt-step-wait-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--color-dot-progress);
}

.pt-step-wait-text {
  flex: 1 1 240px;
}

/* A step that ticked while open (#368): it stays open, done, until Next step opens the next one. */
.pt-step-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-copied-bg);
  color: var(--color-copied-text);
}

.pt-step-next-mark {
  display: flex;
  flex: none;
}

.pt-step-next-text {
  flex: 1 1 200px;
  font-weight: 500;
}

.pt-step-hint {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-notice-bg);
  color: var(--color-notice-text);
}

.pt-step-cases {
  display: flex;
  flex-direction: column;
  padding: 0;
  list-style: none;
}

.pt-case {
  display: flex;
  align-items: baseline;
  color: var(--color-text-soft);
}

.pt-case::before {
  content: "";
  flex: none;
  margin-right: 10px;
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
}

.pt-case-done::before {
  border-color: var(--color-dot-paid);
  background: var(--color-dot-paid);
}

.pt-case-label {
  flex: 1;
  min-width: 0;
}

.pt-case-wait {
  flex: none;
  color: var(--color-text-muted);
}

.pt-case-seen {
  flex: none;
  color: var(--color-paid-text);
  font-weight: 500;
}

/* The first call: one line of code with the drawer's copy button. */
.pt-start-command {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-code-bg);
}

.pt-start-code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 18px;
  white-space: pre;
}

/* Under the steps: the path's links, its plugin and support, and the switch at the end. */
.pt-start-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: -8px;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
}

.pt-start-foot-gap {
  flex: 1;
}

.pt-start-foot .pt-start-switch {
  color: var(--color-text-muted);
}

.pt-start-support {
  color: var(--color-text-soft);
  overflow-wrap: anywhere;
}

/* ---- Settings (spec 0283 §3.2, spec 0286 §3.6, v0.10 §3.6a): a 180px nav column beside Get started, API keys or Account, each
   with its own title; the page scrolls as one. A guide's page reuses the layout, its contents in the nav's place. ---- */

.pt-settings {
  overflow-y: auto;
}

.pt-settings-layout {
  display: flex;
  align-items: flex-start;
}

/* Settings' sidebar (#317): Account, Developers and Docs with its guides and files; hidden on Get started. */
.pt-settings-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex: none;
  flex-direction: column;
  width: 200px;
}

.pt-settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--color-text-soft);
  font-weight: 500;
  text-decoration: none;
}

.pt-settings-link:hover {
  background: var(--color-row-hover);
  color: var(--color-text);
}

.pt-settings-link[aria-current="page"] {
  background: var(--color-segment);
  color: var(--color-text);
  font-weight: 600;
}

.pt-settings-nav-h,
.pt-guide-contents-h {
  margin: 0 10px 6px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pt-settings-file,
.pt-settings-a,
.pt-guide a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.pt-settings-file {
  display: block;
  margin-top: 10px;
}

.pt-settings-file:hover,
.pt-settings-a:hover,
.pt-guide a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.pt-settings-small,
.pt-settings-note {
  margin-top: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
}

/* Get started, Developers and Settings (#317): one column in the middle of the page; Docs is wider, for its sidebar and contents. */
.pt-settings-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
}

/* Each sub-page is a column with the design's 22px between its parts; the title is the sheet's, at 24px. */
.pt-settings-account,
.pt-settings-keys,
.pt-settings-signin,
.pt-start,
.pt-start-view,
.pt-start-choice {
  display: flex;
  flex-direction: column;
}

.pt-title.pt-settings-title {
  margin: 0;
  font-size: 24px;
  line-height: 30px;
}

.pt-settings-head-text {
  display: flex;
  flex-direction: column;
}

.pt-settings-lede {
  margin: 0;
  color: var(--color-text-soft);
}

.pt-settings-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Settings' panels stack at the column's full width (#317): a merchant ID is 36 characters and must read whole. */
.pt-settings-grid {
  display: flex;
  flex-direction: column;
}

.pt-settings-grid > .pt-settings-panel {
  min-width: 0;
}

/* Account's panels (v0.10 §3.6a): a bordered box per group; Sites spans the grid. */
.pt-settings-panel {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}



.pt-settings-panel .pt-settings-row dt {
  width: 120px;
}



.pt-settings-block-h {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.pt-settings-values {
  margin: 0;
}

.pt-settings-row {
  display: flex;
  align-items: baseline;
}

.pt-settings-row + .pt-settings-row {
  margin-top: 8px;
}

.pt-settings-row dt {
  flex: none;
  width: 160px;
  padding-right: 8px;
  color: var(--color-text-muted);
}

.pt-settings-row dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.pt-settings-sites {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-settings-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--color-divider);
}

.pt-settings-item-label {
  flex: 1 1 160px;
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.pt-settings-item-value {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.pt-settings-site-keys {
  color: var(--color-text-muted);
}

.pt-settings-site-retired {
  color: var(--color-text-muted);
  font-style: italic;
}

.pt-settings-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Settings → API keys (spec 0286 §3.4; v0.10 §3.6a, the Settings redesign of #309): the title and its sentence beside Create key;
   the panel in the page; each key two lines, revoked keys folded under one line; the confirmation under the row it names. */
.pt-keys-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.pt-keys-head > .pt-button {
  flex: none;
}

.pt-keys-panel {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-code-bg);
}

.pt-keys-form,
.pt-keys-shown {
  display: flex;
  flex-direction: column;
}

.pt-keys-panel-h {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.pt-keys-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* The form (#317): the store first, as visible choices, then the name it fills in; each with its label above. */
.pt-keys-field {
  display: flex;
  flex-direction: column;
}

.pt-keys-stores {
  margin: 0;
  padding: 0;
  border: 0;
}

.pt-keys-legend {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-weight: 500;
}

.pt-keys-store-list {
  display: flex;
  flex-wrap: wrap;
}

.pt-keys-store {
  display: flex;
  align-items: center;
  margin: 0 8px 8px 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  cursor: pointer;
}

.pt-keys-store > input {
  margin: 0 8px 0 0;
}

.pt-keys-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
}

.pt-keys-input:focus-visible {
  outline: 2px solid transparent;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.pt-keys-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pt-keys-primary {
  border-color: var(--color-primary-bottom);
  background: var(--color-primary-bottom);
  color: var(--color-on-button);
}

.pt-keys-primary:hover {
  background: var(--color-accent-hover);
}

.pt-keys-danger {
  border-color: var(--color-error);
  background: var(--color-error);
  color: var(--color-on-button);
}

.pt-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.pt-keys-primary:disabled:hover {
  background: var(--color-primary-bottom);
}

.pt-keys-secret {
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
}

.pt-keys-key {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  user-select: all;
}

.pt-keys-warning {
  margin: 0;
  color: var(--color-text-soft);
}

.pt-keys-list,
.pt-keys-revoked {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-keys-item {
  border-top: 1px solid var(--color-divider);
}

/* The keys as a table (#317): one row per key, a value per column under its heading; Store and Created give way when narrow. */
.pt-keys-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
}

.pt-keys-cols {
  padding: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* The headings sit right on the rows: the first row's own top rule is the line under them. */
.pt-settings-keys > .pt-keys-cols:not([hidden]) + .pt-keys-list {
  margin-top: 0;
}

.pt-keys-c-name {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
}

.pt-keys-c-mode {
  flex: none;
  width: 72px;
}

.pt-keys-c-store {
  flex: none;
  width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-keys-c-created,
.pt-keys-c-used {
  flex: none;
  width: 120px;
  font-variant-numeric: tabular-nums;
}

.pt-keys-c-act {
  flex: none;
  width: 64px;
  text-align: right;
}

.pt-keys-list .pt-keys-c-store,
.pt-keys-list .pt-keys-c-created,
.pt-keys-list .pt-keys-c-used {
  color: var(--color-text-soft);
}

.pt-keys-label {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pt-keys-env {
  display: inline-block;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--color-segment);
  color: var(--color-text-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

.pt-keys-env-live {
  background: var(--color-copied-bg);
  color: var(--color-copied-text);
}

.pt-keys-meta {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Settings → Sign-in's passkey rows (#543): the API keys list's rows, with one column for what the passkey is and one for Remove. */
.pt-pk-c-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.pt-pk-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.pt-pk-title > .pt-keys-env {
  margin-left: 8px;
}

.pt-pk-c-main > .pt-keys-meta {
  margin-top: 2px;
}

.pt-keys-revoke-open {
  color: var(--color-text-soft);
}

.pt-keys-revoke-open:hover {
  color: var(--color-error);
}

/* The confirmation, under the row it names (the one confirmation, moved there by portal-keys.js). */
.pt-keys-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-error-bg);
  color: var(--color-error);
}

.pt-keys-confirm-name {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pt-keys-confirm-text {
  flex: 1 1 200px;
  margin: 0;
}

.pt-keys-confirm .pt-settings-error {
  flex-basis: 100%;
}

.pt-keys-confirm .pt-button {
  height: 30px;
}

.pt-keys-revoked-wrap {
  border-top: 1px solid var(--color-divider);
}

.pt-keys-revoked-head {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 14px 0;
  color: var(--color-text-muted);
}

.pt-keys-revoked-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--color-divider);
}

.pt-keys-revoked-item .pt-keys-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

/* A guide (#317): a Settings sub-page, so the sidebar stays; the guide's contents in a column on its right, the section in view
   marked as it scrolls. The body is HTML from src/merchant-docs/render.ts, styled here and nowhere inline. */
.pt-settings-main-guide {
  max-width: 1200px;
}

/* Docs' guides, under Docs while one is open: indented a step, a size smaller; Docs itself reads as the open section. */
.pt-settings-docs {
  display: flex;
  flex-direction: column;
}

.pt-settings-docs > * + * {
  margin-top: 2px;
}

.pt-settings-link-sub {
  padding-left: 22px;
  font-size: 13px;
}

.pt-settings-link[aria-current="true"] {
  color: var(--color-text);
  font-weight: 600;
}

/* Developers' WooCommerce plugin panel (#317): the latest version, and its download on the right. */
.pt-settings-plugin-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pt-settings-plugin-line > .pt-settings-note {
  margin: 0;
}

/* The guides' files, under the contents: links, not pages. */
.pt-guide-files-h {
  margin-top: 20px;
}

.pt-guide-files {
  margin: 0;
  padding: 0 10px;
  list-style: none;
}

.pt-guide-files > li + li {
  margin-top: 6px;
}

/* Developers: the page's title, then API keys under its own heading. */
.pt-keys-title {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}


.pt-guide-cols {
  display: flex;
  align-items: flex-start;
}

.pt-guide-cols > .pt-guide {
  flex: 1;
  min-width: 0;
  max-width: 680px;
}

.pt-guide-contents {
  position: sticky;
  top: 0;
  flex: none;
  width: 200px;
  margin-left: 40px;
}

.pt-guide-contents ol {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---- Settings → Sign-in (spec 0312 §3.5): the state line, its buttons, and the panel the API keys' panel also is. The QR code sits
   beside the key, and above it when narrow. ---- */

.pt-auth-state {
  margin: 0;
  font-weight: 500;
}

.pt-auth-done {
  margin: 0;
  color: var(--color-text-soft);
}

.pt-auth-actions {
  justify-content: flex-start;
}

.pt-auth-setup-cols {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 12px;
}

.pt-auth-qr {
  flex: none;
  margin: 0 20px 12px 0;
}

.pt-auth-qr-code {
  display: block;
  width: 184px;
  height: 184px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.pt-auth-qr-light { fill: var(--color-qr-light); }

.pt-auth-qr-dark { fill: var(--color-qr-dark); }

.pt-auth-key-col {
  flex: 1 1 240px;
  min-width: 0;
}

.pt-auth-key-col > :not([hidden]) ~ :not([hidden]) {
  margin-top: 8px;
}

.pt-auth-key-col > .pt-keys-legend {
  margin: 0;
}

/* The key is typed by hand into an app: it wraps on a narrow screen instead of ending in the copy text's ellipsis. */
.pt-auth-key-col .pt-keys-key {
  overflow: visible;
  white-space: normal;
}

.pt-auth-code {
  flex: none;
  width: 140px;
  letter-spacing: 0.2em;
}

.pt-auth-code[aria-invalid="true"] {
  border-color: var(--color-error);
}

/* ---- Settings' spacing (v0.10, #309). The compatibility floor has no flex or grid gap (tests/lints/hosted-page-css.test.ts), so
   the design's gaps are margins between visible siblings: a hidden part leaves no space. Last in Settings' rules, so it wins by order
   over a part's own margin: 0. ---- */

.pt-settings-account > :not([hidden]) ~ :not([hidden]),
.pt-settings-keys > :not([hidden]) ~ :not([hidden]),
.pt-settings-signin > :not([hidden]) ~ :not([hidden]),
.pt-start > :not([hidden]) ~ :not([hidden]),
.pt-start-view > :not([hidden]) ~ :not([hidden]),
.pt-start-choice > :not([hidden]) ~ :not([hidden]) {
  margin-top: 22px;
}

.pt-settings-main > :not([hidden]) ~ :not([hidden]) {
  margin-top: 16px;
}

.pt-settings-panel > :not([hidden]) ~ :not([hidden]),
.pt-keys-panel > :not([hidden]) ~ :not([hidden]),
.pt-auth-panel > :not([hidden]) ~ :not([hidden]),
.pt-keys-form > :not([hidden]) ~ :not([hidden]),
.pt-keys-shown > :not([hidden]) ~ :not([hidden]),
.pt-start-head > :not([hidden]) ~ :not([hidden]),
.pt-step-open .pt-step-body > :not([hidden]) ~ :not([hidden]) {
  margin-top: 12px;
}

.pt-step-open > :not([hidden]) ~ :not([hidden]) {
  margin-top: 14px;
}

.pt-start-steps > :not([hidden]) ~ :not([hidden]) {
  margin-top: 8px;
}

.pt-settings-head-text > :not([hidden]) ~ :not([hidden]),
.pt-step-cases > :not([hidden]) ~ :not([hidden]) {
  margin-top: 6px;
}

.pt-start-live > :not([hidden]) ~ :not([hidden]) {
  margin-top: 4px;
}

.pt-settings-nav > :not([hidden]) ~ :not([hidden]),
.pt-guide-contents ol > :not([hidden]) ~ :not([hidden]) {
  margin-top: 2px;
}

.pt-settings-layout > :not([hidden]) ~ :not([hidden]) {
  margin-left: 40px;
}

.pt-settings-nav > .pt-settings-nav-h:not(:first-child) {
  margin-top: 22px;
}


.pt-keys-head > :not([hidden]) ~ :not([hidden]),
.pt-keys-row > :not([hidden]) ~ :not([hidden]),
.pt-start-begin > :not([hidden]) ~ :not([hidden]),
.pt-step-actions > :not([hidden]) ~ :not([hidden]),
.pt-settings-item > :not([hidden]) ~ :not([hidden]) {
  margin-left: 16px;
}

.pt-start-runs > :not([hidden]) ~ :not([hidden]),
.pt-start-preview > li > :not([hidden]) ~ :not([hidden]) {
  margin-left: 14px;
}

.pt-start-head-line > :not([hidden]) ~ :not([hidden]),
.pt-step-line > :not([hidden]) ~ :not([hidden]) {
  margin-left: 12px;
}

.pt-case > :not([hidden]) ~ :not([hidden]) {
  margin-left: 10px;
}

.pt-keys-actions > :not([hidden]) ~ :not([hidden]),
.pt-keys-revoked-head > :not([hidden]) ~ :not([hidden]),
.pt-step-wait > :not([hidden]) ~ :not([hidden]),
.pt-step-next > :not([hidden]) ~ :not([hidden]) {
  margin-left: 8px;
}

.pt-start-bar > :not([hidden]) ~ :not([hidden]) {
  margin-left: 4px;
}

/* Account's two panels side by side, Sites under them across the row. */
.pt-settings-grid > .pt-settings-panel + .pt-settings-panel {
  margin-top: 16px;
}

/* A panel's closing note sits at its foot, so the two panels' notes line up. */
.pt-settings-panel > :not([hidden]) ~ .pt-settings-panel-foot {
  margin-top: auto;
  padding-top: 12px;
}

.pt-start-live > :not([hidden]) ~ .pt-start-live-actions {
  margin-top: 10px;
}

/* Rows that wrap: each part keeps its space to the right and below. */
.pt-start-foot > * {
  margin: 0 16px 8px 0;
}

.pt-start-foot > .pt-start-foot-gap {
  margin-right: 0;
}

.pt-keys-confirm > * {
  margin: 2px 12px 2px 0;
}

.pt-keys-revoked-item > * {
  margin-right: 14px;
}

.pt-guide {
  font-size: 14px;
  line-height: 22px;
}

.pt-guide h1,
.pt-guide h2,
.pt-guide h3,
.pt-guide h4 {
  margin: 28px 0 10px;
  font-weight: 650;
  scroll-margin-top: 12px;
}

.pt-guide h1 {
  margin-top: 0;
  font-size: 24px;
  line-height: 30px;
}

.pt-guide h2 {
  font-size: 19px;
  line-height: 26px;
}

.pt-guide h3 {
  font-size: 16px;
  line-height: 22px;
}

.pt-guide h4 {
  font-size: 14px;
  line-height: 20px;
}

.pt-guide > h2:first-child {
  margin-top: 0;
}

.pt-guide p,
.pt-guide ul,
.pt-guide ol,
.pt-guide blockquote {
  margin: 0 0 12px;
}

.pt-guide ul,
.pt-guide ol {
  padding-left: 22px;
}

.pt-guide li + li {
  margin-top: 4px;
}

.pt-guide li > ul,
.pt-guide li > ol {
  margin: 4px 0 0;
}

.pt-guide blockquote {
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--color-border-strong);
  color: var(--color-text-soft);
}

.pt-guide hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--color-divider);
}

.pt-guide code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--color-code-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.pt-guide-code {
  position: relative;
  margin: 0 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-code-bg);
}

.pt-guide-code pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 18px;
}

.pt-guide-code pre code {
  padding: 0;
  background: transparent;
  white-space: pre;
}

.pt-guide-code-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 13px;
  background: var(--color-surface);
  color: var(--color-text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pt-guide-code-copy:hover {
  color: var(--color-text);
}

.pt-guide-code-copy.pt-copied {
  border-color: var(--color-copied-bg);
  background: var(--color-copied-bg);
  color: var(--color-copied-text);
}

.pt-guide .pt-guide-caption {
  margin: 0 0 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.pt-guide-table {
  margin: 0 0 14px;
  overflow-x: auto;
}

.pt-guide-table table {
  border-collapse: collapse;
  font-size: 13px;
  line-height: 18px;
}

.pt-guide-table th,
.pt-guide-table td {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.pt-guide-table th {
  background: var(--color-segment);
  font-weight: 600;
}

.pt-guide-table .pt-align-center {
  text-align: center;
}

.pt-guide-table .pt-align-right {
  text-align: right;
}

/* The drawer is docked at the window's right, under the header and beside the sheet, with no shadow (Final v2 page.html 280):
   a fixed top (reference, headline) over a body that scrolls. Final v2's is a content-box 440px with a 1px border, so its card
   is 440px wide and the drawer 441px (989 to 1430 in a 1440px window, its border over the sheet's last pixel). 440px by default;
   portal.js sets --pt-drawer-width on #pt-app from the browser's stored layout (spec 0208 v5.2 §6.2). */
.pt-drawer {
  position: absolute;
  top: 56px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  box-sizing: content-box;
  width: var(--pt-drawer-width, 440px);
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--color-drawer-border);
  border-radius: 0 14px 14px 0;
  background: var(--color-surface);
  font-size: 14px;
  line-height: 20px;
  --pt-ink: var(--color-text);
}

/* The drawer's handle (spec 0208 v5.2 §6.2): an 8px strip over its left border; a 2px bar in the accent shows on hover, focus and while dragging. */
.pt-d-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
}

.pt-d-resize::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--color-accent);
  opacity: 0;
}

.pt-d-resize:hover::after,
.pt-d-resize:focus-visible::after,
.pt-resizing .pt-d-resize::after {
  opacity: 1;
}

.pt-d-resize:focus-visible {
  outline: 2px solid transparent;
}

/* While a handle is dragged nothing selects and the cursor stays the resize cursor wherever the pointer goes. */
.pt-resizing,
.pt-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* ---- Chips: a label, a value and a chevron; the native select lies over the whole chip ---- */

.pt-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 32px 0 14px;
  border: 0;
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
  color: var(--color-text);
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.pt-chip:not(.pt-chip-set):hover {
  background: var(--color-row-hover);
}

/* A label chip rings while its select has focus. The Created chip is a button: its ring follows :focus-visible, so a mouse click leaves none. */
label.pt-chip:focus-within {
  outline: 2px solid transparent;
  box-shadow: inset 0 0 0 1px var(--color-accent), 0 0 0 3px var(--color-focus-ring);
}

button.pt-chip:focus-visible {
  outline: 2px solid transparent;
  box-shadow: inset 0 0 0 1px var(--color-accent), 0 0 0 3px var(--color-focus-ring);
}

.pt-chip-key {
  margin-right: 6px;
  color: var(--color-text-muted);
}

.pt-chip-value {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.pt-chip-chevron {
  position: absolute;
  top: 9px;
  right: 10px;
  color: var(--color-icon);
}

/*
 * A set filter fills its chip dark. The key and the chevron take the readable grey: the prototype's #5D6778 on #0B1220 was not.
 * Each rule here is more specific than the unset rule it replaces, so none depends on order; the focus rings above are more
 * specific still (an element selector), so a set chip rings as an unset one does.
 */
.pt-chip.pt-chip-set {
  background: var(--color-button);
  box-shadow: inset 0 0 0 1px var(--color-button);
  color: var(--color-on-button);
}

.pt-chip-set .pt-chip-key,
.pt-chip-set .pt-chip-chevron {
  color: var(--color-on-canvas-key);
}

.pt-chip-set .pt-chip-value {
  color: var(--color-on-button);
}

/* The attention count on the Outcome control: amber on a light chip, the lighter amber on a dark one, absent when empty (spec 0208 §5.3). */
.pt-count {
  margin-left: 6px;
  color: var(--color-attention-text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.pt-count:empty {
  display: none;
}

.pt-chip-set .pt-count {
  color: var(--color-attention-on-dark);
}

/* The Created chip: "Created  Any time" while unset; once a range is set, a dark pill that reads "Oct 1 – Oct 27" beside its calendar. */
.pt-chip-date .pt-date-icon {
  display: none;
  margin-right: 8px;
  color: var(--color-chrome-focus);
}

.pt-chip-set.pt-chip-date .pt-date-icon {
  display: block;
}

/* "Created" leaves the eye then, but not the button's name (the .pt-sr recipe): a screen reader still hears what the range is for. */
.pt-chip-set.pt-chip-date .pt-chip-key {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pt-chip-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.pt-chip-select option {
  background: var(--color-surface);
  color: var(--color-text);
}

/* ---- Title and the filter row --------------------------------------------- */

.pt-top {
  flex: none;
  padding: 28px 32px 0;
}

/* Final v2's sign-out-failed banner (page.html 182-186): no edge, radius 12, 8px of padding and 14px before the text, 18px
   under it. The refresh-failed notice and the drawer's error line wear it too (spec 0208 section 6.2). */
.pt-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 8px 8px 8px 14px;
  border-radius: 12px;
  background: var(--color-error-bg);
  color: var(--color-error-strong);
  font-size: 13px;
}

/* Under the filters row, whose last controls already keep 8px below them; the table follows the notice. */
.pt-banner-list {
  margin: 0 0 12px;
}

.pt-banner-close {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--color-error-strong);
  cursor: pointer;
}

.pt-banner-close:hover {
  background: var(--color-banner-hover);
}

/* The drawer error line's Try again: Dismiss's button with a word in it, the two together at the line's right end
   (operator, 2026-10-29). Its colours are .pt-banner-close's. */
.pt-banner-retry {
  width: auto;
  margin-left: auto;
  padding: 0 10px;
  font: inherit;
  font-weight: 600;
}

.pt-banner-retry + .pt-banner-close {
  margin-left: 4px;
}

.pt-title {
  margin: 0;
  font-size: 30px;
  line-height: 36px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

/* One row of 36px pills under the title; it wraps when the sheet is narrow. */
.pt-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}

/* The row owns the 8px between its controls, to the right and below, so a wrapped line keeps its rhythm. Reset is the exception. */
.pt-filters-row > :not(.pt-reset) {
  margin: 0 8px 8px 0;
}

.pt-tool {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
}

.pt-tool:hover {
  background: var(--color-row-hover);
  color: var(--color-text);
}

.pt-search {
  position: relative;
  width: 300px;
  max-width: 100%;
}

.pt-search-input {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 14px 0 36px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--color-segment);
  color: var(--color-text);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}

.pt-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.pt-search-input::placeholder {
  color: var(--color-text-muted);
}

.pt-search-input:focus {
  background: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  outline: 2px solid transparent;
}

.pt-search-icon {
  position: absolute;
  top: 10px;
  left: 14px;
  color: var(--color-text-muted);
  pointer-events: none;
}

/* The mode line sits where the export puts it, right-aligned under the field, but out of the flow: an in-flow line
   would push the table down while someone types. Here it takes the 8px under the field and the table's own 4px of
   top padding, so nothing moves. */
.pt-search-mode {
  position: absolute;
  top: 100%;
  right: 0;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
}

/* Environment: three toggle buttons on one track, the chosen one raised (Final v2). */
.pt-segment {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 3px;
  border-radius: 18px;
  background: var(--color-segment);
}

.pt-segment-btn {
  display: flex;
  text-decoration: none; /* Get started's switch is two links (#317), one per path's address */
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--color-text-soft);
  font-weight: 400;
  cursor: pointer;
}

.pt-segment-btn[aria-pressed="true"],
.pt-segment-btn[aria-current="page"] {
  background: var(--color-surface);
  box-shadow: 0 1px 2px var(--color-segment-shadow);
  color: var(--color-text);
  font-weight: 500;
}

/* The ring sits inside each button: the track is only 3px wider than they are, and an outer ring would spill over its neighbours. */
.pt-segment-btn:focus-visible {
  outline-offset: -2px;
}

/* The auto margin takes what is left of Reset's line: Reset ends at the right, flush with the sheet's padding, on whichever line it wraps to. */
.pt-reset {
  height: 36px;
  margin: 0 0 8px auto;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--color-text-soft);
  font-weight: 500;
  cursor: pointer;
}

.pt-reset:hover {
  background: var(--color-segment);
  color: var(--color-text);
}

.pt-created {
  position: relative;
  display: inline-flex;
}

.pt-pop {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 5;
  width: 248px;
  padding: 12px;
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-border), 0 16px 32px -12px var(--color-pop-shadow);
}

.pt-pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pt-pop-row + .pt-pop-row {
  margin-top: 8px;
}

.pt-pop-label {
  color: var(--color-text-muted);
}

.pt-date {
  width: 168px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.pt-date:focus {
  box-shadow: inset 0 0 0 1px var(--color-accent), 0 0 0 3px var(--color-focus-ring);
  outline: 2px solid transparent;
}

.pt-pop-actions {
  margin-top: 10px;
  text-align: right;
}

/* ---- The table: scrolls inside the card, its head with it (Final v2) ------- */

.pt-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 32px 0;
}

/* Customer keeps its floor (ruling P2b-R17), a fixed 200px: it has no handle and takes the room the others leave (ruling P2b1-R9).
   The floor is the fixed and resizable columns, the first and last cell's 8px and that 200px; below the sum the list scrolls
   sideways in #pt-scroll, so widening another column widens the table and Customer is not squeezed. 772px (staff 882px) at the
   defaults. */
.pt-table {
  width: 100%;
  min-width: calc(116px + var(--pt-col-ref, 100px) + 200px + var(--pt-col-amount, 128px) + var(--pt-col-outcome, 168px) + 44px + 16px);
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

/* Both classes: (0,2,0) beats `.pt-table` by specificity, not by coming after it. The compact reset `.pt-table.pt-compact` ties this
   and wins by order: its block comes after this rule. */
.pt-table.pt-staff {
  min-width: calc(112px + var(--pt-col-merchant, 130px) + var(--pt-col-ref, 96px) + 200px + var(--pt-col-amount, 124px) + var(--pt-col-outcome, 160px) + 44px + 16px);
}

/* Final v2's sizes are content sizes: a head of 36px and rows of 54px, each with a 1px rule under it, and columns of
   116px to 44px with 8px of row padding outside the first and last. So the cells are content-box here, and the first
   and last cell's 8px adds to its column. The Amount column is the exception: its 24px of padding is inside its 128px. */
.pt-table th,
.pt-table td {
  box-sizing: content-box;
}

.pt-table th {
  position: relative;
  height: 36px;
  padding: 0;
  border-bottom: 1px solid var(--color-divider);
  background: transparent;
  color: var(--color-text-head);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}

/* "Created · ET": the viewer's zone beside the times, its full name on hover (spec 0208 v5 §6.2; plan 2b, decision 2).
   The text starts with the space before the dot, so a margin would push the dot off centre (7.4px before it, 3.4px after). */
.pt-zone {
  font-weight: 400;
  color: var(--color-text-muted);
}

/* A zone with no short name is an offset ("GMT+5:30", "GMT+13:45"), up to 122px with "Created" before it: the head ends
   in an ellipsis instead of running into Reference, and the note's title names the zone in full. */
.pt-table th.pt-col-created {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-table td {
  height: 54px;
  padding: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--color-divider);
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.pt-table th:first-child,
.pt-table td:first-child {
  padding-left: 8px;
}

.pt-table th:last-child,
.pt-table td:last-child {
  padding-right: 8px;
}

/* Final v2's grid (page.html 383): Customer takes the rest. The columns are the same with the drawer open;
   they change only in the compact list, whose .pt-compact block near the end of this file owns them (spec 0208 v5.2 §6.2).
   A resizable column reads its --pt-col- property, which portal.js sets on the table from the browser's stored layout (spec 0208
   v5.2 §6.2); the fallback is the design width, pinned equal to portal-layout.js's default. Customer has no width and takes the rest. */
.pt-col-created { width: 116px; }
.pt-col-merchant { width: var(--pt-col-merchant, 130px); }
.pt-col-ref { width: var(--pt-col-ref, 100px); }
.pt-col-amount { width: var(--pt-col-amount, 128px); }
.pt-col-outcome { width: var(--pt-col-outcome, 168px); }
.pt-col-env { width: 44px; }
.pt-staff .pt-col-created { width: 112px; }
.pt-staff .pt-col-merchant { width: var(--pt-col-merchant, 130px); }
.pt-staff .pt-col-ref { width: var(--pt-col-ref, 96px); }
.pt-staff .pt-col-amount { width: var(--pt-col-amount, 124px); }
.pt-staff .pt-col-outcome { width: var(--pt-col-outcome, 160px); }

/* The column handles (spec 0208 v5.2 §6.2): a 9px strip over each resizable heading's right edge, a hairline on hover, focus and drag;
   portal-layout.js holds the bounds. Created, Customer and Environment have none. The compact list keeps its own widths and shows none. */
.pt-col-handle {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 1;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.pt-col-handle::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;
  width: 1px;
  background: var(--color-border-strong);
  opacity: 0;
}

.pt-col-handle:hover::after,
.pt-col-handle:focus-visible::after,
.pt-resizing .pt-col-handle::after {
  opacity: 1;
}

.pt-col-handle:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--color-accent);
  border-radius: 2px;
}

#pt-rows tr {
  cursor: pointer;
}

/* An unresolved payment's row is tinted (T4). Hover, selection and focus come after and take over. */
tr.pt-row-attention td {
  background: var(--color-attention-tint);
}

/* A tr takes neither a radius nor a shadow, so what the design puts on the row is drawn through its cells; the bar is the first
   cell's inset shadow, which follows its rounded corner. Hover comes before selection: equal specificity, so order gives selection the win. */
#pt-rows tr:hover td {
  background: var(--color-row-hover);
}

#pt-rows tr[aria-selected="true"] td {
  background: var(--color-row-selected);
}

#pt-rows tr[aria-selected="true"] td:first-child {
  border-radius: 8px 0 0 8px;
  box-shadow: inset 3px 0 0 var(--color-row-selected-bar);
}

#pt-rows tr[aria-selected="true"] td:last-child {
  border-radius: 0 8px 8px 0;
}

/* The keyboard's focus: an inset 2px ring in the same pattern. :focus-visible, so a mouse click selects without ringing. The
   cells draw the ring; the row's transparent outline, inside its box, is what forced-colors mode shows instead. */
#pt-rows tr:focus-visible {
  outline: 2px solid transparent;
  outline-offset: -2px;
}

#pt-rows tr:focus-visible td {
  box-shadow: inset 0 2px 0 var(--color-accent), inset 0 -2px 0 var(--color-accent);
}

#pt-rows tr:focus-visible td:first-child {
  box-shadow: inset 2px 2px 0 var(--color-accent), inset 0 -2px 0 var(--color-accent), inset 2px 0 0 var(--color-accent);
}

#pt-rows tr:focus-visible td:last-child {
  box-shadow: inset -2px 2px 0 var(--color-accent), inset 0 -2px 0 var(--color-accent), inset -2px 0 0 var(--color-accent);
}

/* A focused selected row keeps its bar under the ring: one box-shadow carries both, the bar first so it is drawn on top. The row's
   transparent outline above still serves forced-colors mode. */
#pt-rows tr[aria-selected="true"]:focus-visible td:first-child {
  box-shadow: inset 3px 0 0 var(--color-row-selected-bar), inset 2px 2px 0 var(--color-accent), inset 0 -2px 0 var(--color-accent), inset 2px 0 0 var(--color-accent);
}

/* The design's last row has no rule under it. */
#pt-rows tr:last-child td {
  border-bottom-color: transparent;
}

/* Outside the current year the date carries the year ("Dec 30, 2025, 22:58"), wider than the column: the time wraps
   under its date instead of ending in an ellipsis (ruling P2b-R16). The row's 54px holds up to three lines. */
#pt-rows td.pt-created-cell {
  color: var(--color-text-soft);
  font-variant-numeric: tabular-nums;
  white-space: normal;
  text-overflow: clip;
}

td.pt-merchant-cell {
  padding-right: 12px;
}

.pt-ref {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

td.pt-customer {
  padding-right: 16px;
}

.pt-name,
.pt-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-email {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
}

.pt-unavailable {
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: italic;
}

/* The Amount head is right-aligned over the figures, 24px in from the Outcome column (T10). `.pt-table th`
   (specificity 0,1,1) sets text-align and padding, so a bare `.pt-amount` loses to it on the head cell; these
   selectors carry the element and the table. */
.pt-table th.pt-amount,
.pt-table td.pt-amount {
  box-sizing: border-box;
  padding-right: 24px;
  text-align: right;
}

/* Money is never cut (ruling P2b-R15). The content box is 104px (staff 100px) and MXN 1,234,567.89 is 124px: an amount
   that does not fit spills into the cell's own 24px gutter instead of ending in an ellipsis. The currency and the figure
   cannot break apart (nowrap). The row id makes this beat `.pt-table td`, which a bare `td.pt-amount` only ties. */
#pt-rows td.pt-amount {
  overflow: visible;
  text-overflow: clip;
}

td.pt-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pt-ccy {
  margin-right: 5px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.pt-outcome {
  font-weight: 500;
}

.pt-outcome-needs_attention {
  color: var(--color-attention-text);
  font-weight: 600;
}

/* The glyph and the label share one 24px pill, so the cell stays a table cell (T12). */
.pt-outcome-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  white-space: nowrap;
}

/* The outcome's glyph (spec 0208 §6.2, issue #298): the sprite's i-mark-<outcome>, a ring with the outcome's mark inside,
   stroked in the outcome colour. One glyph per outcome: whether the payment is final is said in words (the cell's tooltip
   and screen-reader text, the drawer's line), not by the glyph. outcomeGlyph builds it for the list (14px) and the
   drawer's headline (18px). An outcome this page does not know gets i-mark-unknown, the ring alone, in the neutral grey. */
.pt-glyph {
  position: relative;
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  color: var(--color-decor);
  vertical-align: -3px;
}

.pt-glyph .pt-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: inherit;
  stroke-width: 1.9;
}

.pt-glyph-needs_attention .pt-icon {
  stroke-width: 2;
}

/* The exclamation's dot. A selector cannot reach into a <use> instance from outside it, so this is the dot's own class. */
.pt-mark-fill {
  fill: currentColor;
  stroke: none;
}

.pt-glyph-paid { color: var(--color-dot-paid); }
/* Issue #401: a refunded payment is a routine end too: the same muted grey, not the paid green. */
.pt-glyph-refunded { color: var(--color-text-muted); }
.pt-glyph-declined { color: var(--color-dot-failed); }
/* Issue #325: an expired or replaced payment is a routine end, not a fault: the muted grey, 5.9:1 on the sheet. */
.pt-glyph-expired { color: var(--color-text-muted); }
.pt-glyph-canceled { color: var(--color-text-muted); }
.pt-glyph-failed { color: var(--color-dot-failed); }
.pt-glyph-in_progress { color: var(--color-dot-progress); }
/* Spec 0199 §3.7: a challenge the customer left is not a fault: the muted grey, as an expired payment's. */
.pt-glyph-not_completed { color: var(--color-text-muted); }
.pt-glyph-needs_attention { color: var(--color-dot-attention); }

.pt-glyph-18 {
  width: 18px;
  height: 18px;
  margin-right: 10px;
}

.pt-env-cell {
  text-align: left;
}

.pt-tag-test {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px dashed var(--color-decor);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

/* ---- The payment drawer (TimelineCard.dc.html, variant ledger) ----------- */

/* The outcome's colour for words and the ledger's closing row. The headline's mark is the glyph (outcomeGlyph), which paints itself. */
.pt-tone-paid { --pt-ink: var(--color-paid-text); }
.pt-tone-refunded { --pt-ink: var(--color-text-muted); }
.pt-tone-declined { --pt-ink: var(--color-failed-text); }
.pt-tone-expired { --pt-ink: var(--color-text-muted); }
.pt-tone-canceled { --pt-ink: var(--color-text-muted); }
.pt-tone-failed { --pt-ink: var(--color-failed-text); }
.pt-tone-in_progress { --pt-ink: var(--color-progress-text); }
.pt-tone-not_completed { --pt-ink: var(--color-text-muted); }
.pt-tone-needs_attention { --pt-ink: var(--color-attention-text); }

.pt-d-top {
  flex: none;
  border-bottom: 1px solid var(--color-divider);
}

.pt-d-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px 0 24px;
}

.pt-d-id {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.pt-d-ref {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

/* The title takes focus when a payment opens; a tight ring. */
.pt-d-ref:focus-visible {
  border-radius: 3px;
  outline-offset: 1px;
}

.pt-d-nav {
  display: flex;
  flex: none;
  align-items: center;
  margin-left: 12px;
}

.pt-round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
}

.pt-round:not([aria-disabled="true"]):hover {
  background: var(--color-row-hover);
  color: var(--color-text);
}

.pt-round[aria-disabled="true"] {
  background: transparent;
  color: var(--color-decor);
  cursor: default;
}

.pt-d-close {
  margin-left: 4px;
}

.pt-d-banner {
  margin: 0 24px 16px;
}

.pt-d-summary {
  padding: 0 24px 22px;
}

/* The glyph, the amount and the outcome as one sentence, "(glyph) CAD 50.00 was paid" (Final v2 D3). The glyph is the first
   flex item (renderSummary inserts it; 18px with a 10px margin). A flex container drops the spaces between its items, so
   the outcome and the may-change words carry the gap themselves. */
.pt-d-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.015em;
}

.pt-d-outcome {
  margin-left: 6px;
}

.pt-d-amount {
  color: var(--color-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pt-d-phrase {
  color: var(--pt-ink);
  font-weight: 600;
  white-space: nowrap;
}

.pt-d-nonfinal {
  margin-left: 6px;
  font-size: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}

.pt-d-nfdot {
  margin-right: 4px;
}

/* The headline's line is full (portal.js fitNonFinal): the words take their own line, without the dot, in the column of the lines below. */
.pt-d-wrapped .pt-d-nonfinal {
  display: block;
  margin-left: 19px;
  line-height: 20px;
}

.pt-d-wrapped .pt-d-nfdot {
  display: none;
}

.pt-d-wrapped .pt-d-nonfinal::first-letter {
  text-transform: uppercase;
}

.pt-d-mismatch {
  margin: 8px 0 0 19px;
  color: var(--color-failed-text);
  font-weight: 600;
}

.pt-d-meaning {
  margin: 10px 0 0 19px;
  color: var(--color-text-muted);
}

/* A paid payment has no meaning line (Final v2 D5): an empty paragraph would still take its 10px margin. */
.pt-d-meaning:empty {
  display: none;
}

/* The refund control and states (spec 0371 §3.7), under the headline and over the ledger: the lines of the refunds that ended, then the
   control the open one calls for. Spacing is margins, as everywhere on this page. */
.pt-d-refund {
  padding: 0 24px 22px;
}

.pt-d-refund > * {
  margin: 0 0 10px;
}

.pt-d-refund > :last-child {
  margin-bottom: 0;
}

.pt-d-refund-line {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.pt-d-refund-bad {
  color: var(--color-failed-text);
  font-weight: 600;
}

.pt-d-refund-why {
  display: block;
  color: var(--color-text-muted);
}

.pt-d-refund-state {
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Inside its wrap (with who requested it beneath), the state line keeps the area's spacing: the wrap carries the margin. */
.pt-d-refund-ask > .pt-d-refund-state {
  margin: 0;
}

/* Spec 0491 §3.7: who requested the open refund, under its hold or its processing line; a long address wraps. */
.pt-d-refund-by {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* Ruling P27: a refund's reason, under who requested it, or under an ended refund's line; up to 500 characters, so it wraps. */
.pt-d-refund-reason {
  display: block;
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-variant-numeric: normal;
  overflow-wrap: anywhere;
  white-space: normal;
}

.pt-d-refund-hold {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.pt-d-refund-hold[hidden] {
  display: none;
}

.pt-d-refund-q {
  margin: 0 0 4px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pt-d-refund-note {
  margin: 0 0 10px;
  color: var(--color-text-muted);
}

/* A merchant user's confirmation has two lines here (the hold, then that their team is emailed). */
.pt-d-refund-note-line {
  display: block;
}

.pt-d-refund-actions > * {
  margin: 0 10px 0 0;
}

.pt-d-refund-confirm .pt-keys-field {
  margin: 0 0 12px;
}

/* Staff's required reason (spec 0491 §3.7): the hint sits under the field, and takes the field's space below. */
.pt-d-refund-confirm .pt-d-refund-field-hinted {
  margin: 0 0 6px;
}

.pt-d-refund-hint {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* The reason field sits in a column flex (.pt-keys-field): the keys form's flex: 1 would shrink its height to the row's remainder. */
.pt-d-refund-confirm .pt-keys-input {
  flex: none;
}

/* Spec 0491 §3.7: Send now sits beside Cancel refund; its code entry opens under the hold. The field is the keys form's code input
   (.pt-auth-code, 140px, spaced digits), set in the column flex of .pt-keys-field without the keys form's flex: 1. */
.pt-d-refund-ask > .pt-button + .pt-button {
  margin-left: 10px;
}

.pt-d-refund-code {
  margin: 12px 0 0;
}

.pt-d-refund-code-prompt {
  margin: 0 0 10px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.pt-d-refund-code .pt-d-refund-code-field {
  margin: 0 0 12px;
}

.pt-d-refund-code .pt-keys-input {
  flex: none;
}

.pt-d-refund-error {
  color: var(--color-error);
}

.pt-d-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 24px 24px;
}

/* A focusable scroll region, so the arrow keys scroll it once focused. The ring sits inside the box, as a list row's does. */
.pt-d-body:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.pt-d-loading {
  padding: 22px 0 0 90px;
}

.pt-d-loading .pt-bar + .pt-bar {
  margin-top: 14px;
}

/* The loading bars share the list skeleton's classes but keep the sizes they had (D19): a 96px first bar, and a third that
   is a plain 84 x 10 bar, not the list's 86 x 22 outcome bar. Only the radius follows .pt-bar. */
.pt-d-loading .pt-bar-a {
  width: 96px;
}

.pt-d-loading .pt-bar-e {
  width: 84px;
  height: 10px;
}

/* The ledger: a time column, a 12px column for the dots on their rail, then the entry. */
.pt-ledger {
  margin-top: 14px;
}

.pt-l-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-l-row {
  position: relative;
  display: grid;
  grid-template-columns: 76px 12px minmax(0, 1fr);
  padding-bottom: 22px;
}

.pt-l-day {
  position: relative;
  width: 76px;
  padding: 0 14px 10px 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  text-align: right;
  white-space: normal;
}

/* The rail runs through every row from the first dot to the closing one, in the outcome's colour at its end. */
.pt-l-row::before,
.pt-l-day::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 81px;
  width: 2px;
  background: var(--color-rail);
  content: "";
}

.pt-l-list > .pt-l-day:first-child::before {
  content: none;
}

.pt-l-list > .pt-l-day:first-child + .pt-l-row::before {
  top: 10px;
}

.pt-l-list > .pt-l-row:last-child::before {
  background: linear-gradient(180deg, var(--color-rail) 0%, var(--pt-ink) 100%);
}

.pt-l-end {
  padding-bottom: 4px;
}

.pt-l-end::before {
  bottom: auto;
  height: 10px;
  background: var(--pt-ink);
}

.pt-l-time {
  padding-right: 14px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.pt-l-mark {
  position: relative;
  z-index: 1;
}

.pt-l-dot {
  position: absolute;
  top: 4px;
  left: 0;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-decor);
  border-radius: 6px;
  background: var(--color-surface);
}

.pt-l-paid .pt-l-dot { border-color: var(--color-paid-text); background: var(--color-paid-text); }
.pt-l-failed .pt-l-dot { border-color: var(--color-failed-text); background: var(--color-failed-text); }
.pt-l-attention .pt-l-dot { border-color: var(--color-attention-text); background: var(--color-attention-text); }
.pt-l-progress .pt-l-dot { border-color: var(--color-progress-text); background: var(--color-progress-text); }
.pt-l-end .pt-l-dot { border-color: var(--pt-ink); background: var(--pt-ink); }

/* Not final: a ring, with a halo that pulses only when the viewer allows motion (below). */
.pt-l-open .pt-l-dot {
  background: var(--color-surface);
}

.pt-l-open .pt-l-dot::after {
  position: absolute;
  top: -3px;
  right: -3px;
  bottom: -3px;
  left: -3px;
  border-radius: 99px;
  background: var(--pt-ink);
  opacity: 0;
  content: "";
}

@media (prefers-reduced-motion: no-preference) {
  .pt-l-open .pt-l-dot::after {
    animation: pt-halo 2.4s ease-in-out infinite;
  }
}

@keyframes pt-halo {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.8); }
}

.pt-l-body {
  min-width: 0;
  padding-left: 14px;
}

.pt-l-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

/* The record's titles are longer than the design's ("Being sent to the payment processor"): they wrap, never clip,
   and "attempt n" moves under the title as a whole before the title itself breaks. */
.pt-l-label {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  min-width: 0;
}

.pt-l-title {
  min-width: 0;
  margin-right: 6px;
  overflow-wrap: anywhere;
}

.pt-l-decor .pt-l-title {
  color: var(--color-text-muted);
}

.pt-l-end .pt-l-title {
  color: var(--pt-ink);
  font-weight: 600;
}

.pt-l-sub {
  color: var(--color-text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.pt-l-amt {
  flex: none;
  margin-left: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pt-l-amt:empty {
  display: none;
}

.pt-l-pending {
  color: var(--color-text-muted);
}

.pt-l-struck {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.pt-l-end .pt-l-amt {
  color: var(--pt-ink);
  font-weight: 600;
}

.pt-l-note {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
}

.pt-l-reason {
  color: var(--color-failed-text);
}

.pt-l-raw {
  overflow-wrap: anywhere;
}

.pt-l-warn {
  color: var(--color-attention-text);
}

.pt-l-conv {
  font-variant-numeric: tabular-nums;
}

/* Customer and Payment: a label in the time column, the values beside the rail. */
.pt-d-section {
  display: grid;
  grid-template-columns: 76px 12px minmax(0, 1fr);
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
}

.pt-d-section + .pt-d-section {
  margin-top: 16px;
}

.pt-d-h {
  margin: 0;
  padding-right: 14px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  text-align: left;
}

.pt-d-values {
  grid-column: 3;
  min-width: 0;
  margin: 0;
  padding-left: 14px;
}

.pt-d-cust {
  margin: 0;
}

.pt-d-copyable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
}

.pt-d-copytext,
.pt-d-idtext {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-d-none {
  color: var(--color-text-muted);
  font-style: italic;
}

.pt-d-row {
  display: flex;
  align-items: baseline;
}

.pt-d-row + .pt-d-row {
  margin-top: 2px;
}

.pt-d-row dt {
  flex: none;
  width: 120px;
  padding-right: 8px;
  color: var(--color-text-muted);
}

.pt-d-row dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

/* The Card row (issue #376): a small white frame holding the brand's full-colour mark, then the text. The mark is not .pt-icon,
   which sets fill: none and a currentColor stroke; i-card is the one stroked icon here and wears pt-icon in the muted colour. */
.pt-d-row-card {
  align-items: center;
}

.pt-d-card {
  display: flex;
  align-items: center;
}

.pt-card-frame {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 21px;
  margin-right: 8px;
  overflow: hidden;
  border: 1px solid var(--color-brand-frame-border);
  border-radius: 4px;
  background: var(--color-brand-frame-bg);
  color: var(--color-text-muted);
}

/* 24x22 holds both shapes at the approved sizes: a Simple Icons mark (viewBox 24x24) scales to 22x22, Mastercard's (24x16) stays 24x16,
   each centred; the frame's 19px inside clips only the empty top and bottom of a wide wordmark (Visa, Discover, JCB). The Amex
   box and the Diners circle fill their square, so their symbols carry a padded viewBox (-2 -2 28 28) and draw at about 19px. */
.pt-card-mark {
  display: block;
  flex: none;
  width: 24px;
  height: 22px;
}

.pt-d-row-copy {
  align-items: center;
}

.pt-d-idtext {
  flex: 1;
  color: var(--color-text-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.pt-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.pt-copy {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  margin-left: 8px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  cursor: pointer;
}

.pt-copy:hover {
  background: var(--color-row-hover);
  color: var(--color-text);
}

.pt-copy.pt-copied {
  padding: 0 8px;
  background: var(--color-copied-bg);
  color: var(--color-copied-text);
}

.pt-copied .pt-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.pt-copy-text:empty {
  display: none;
}

/* ---- Skeleton ------------------------------------------------------------ */

/* Final v2's bars (page.html 393-396): 10px high with radius 5, every one of them (ruling P2b-R24). Each class carries its own width,
   rotating through the rows as the design's `84 + (i % 3) * 8` and its siblings do (i from 0, nth-child from 1): Created
   84/92/100, the two short columns 64/76, Customer 110/124/138/152 over a 150 x 8 second line, Amount 72/82/92 pressed to the
   right of its cell, and an 86 x 22 outcome bar. The drawer's loading bars use the same classes and are held at their own sizes
   above (the drawer section). */
.pt-bar {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--color-skeleton) 0%, var(--color-skeleton-hi) 50%, var(--color-skeleton) 100%);
  background-size: 200% 100%;
  animation: pt-shimmer 1.4s linear infinite;
}

.pt-bar-a { width: 84px; }
.pt-bar-b { width: 64px; }
.pt-bar-c { width: 110px; }
.pt-bar-sub { width: 150px; height: 8px; margin-top: 6px; }
.pt-bar-d { width: 72px; margin-left: auto; }
.pt-bar-e { width: 86px; height: 22px; }
.pt-skeleton tr:nth-child(3n+2) .pt-bar-a { width: 92px; }
.pt-skeleton tr:nth-child(3n) .pt-bar-a { width: 100px; }
.pt-skeleton tr:nth-child(even) .pt-bar-b { width: 76px; }
.pt-skeleton tr:nth-child(4n+2) .pt-bar-c { width: 124px; }
.pt-skeleton tr:nth-child(4n+3) .pt-bar-c { width: 138px; }
.pt-skeleton tr:nth-child(4n) .pt-bar-c { width: 152px; }
.pt-skeleton tr:nth-child(3n+2) .pt-bar-d { width: 82px; }
.pt-skeleton tr:nth-child(3n) .pt-bar-d { width: 92px; }

/* A Load more's bars follow the rows, so the last row's rule shows again above them, as Final v2's does while more loads
   (page.html 391). A first page's bars sit under the head with the rows hidden, and draw no second rule there. */
#pt-rows:not([hidden]) + #pt-skeleton tr:first-child td {
  box-shadow: inset 0 1px 0 var(--color-divider);
}

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

/* ---- Entrance and drawer motion (spec 0208 v5 §6.2; Final v2 M1-M4) ----------

   Final v2's keyframes (page.html 46-49; TimelineCard.html 11-20), once each. Every animation is a rule in this file, gated by a
   class the script sets: pt-entering on #pt-app for 2.8 s after sign-in, pt-d-enter on the drawer from an open until its first
   refresh. A delay that depends on the row is a custom property the script sets (--pt-delay); the script gives the number and
   this file owns every timing, so no timing or colour is written through element.style (the ring's transform and opacity are
   geometry, set by the lens loop). The sign-in ledger's scroll, arrivals and bloom are with the sign-in above; its rows exist only
   while the sign-in is on screen. The reduce block that follows turns every animation off, and nothing animates below it. */

@keyframes pt-drop {
  from { opacity: 0; transform: translateY(-18px) rotateX(-22deg); }
  to { opacity: 1; transform: none; }
}

@keyframes pt-rise {
  from { opacity: 0; transform: translateY(28px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes pt-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pt-tc-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes pt-tc-line {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes pt-tc-pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* The app: the header drops in, the sheet rises behind it, then the title, the filters and the table head follow (M1). */
.pt-entering .pt-header {
  animation: pt-drop 600ms cubic-bezier(.2, .7, .2, 1) 0ms both;
}

.pt-entering .pt-frame {
  animation: pt-rise 700ms cubic-bezier(.2, .7, .2, 1) 90ms both;
}

.pt-entering .pt-title {
  animation: pt-drop 500ms cubic-bezier(.2, .7, .2, 1) 260ms both;
}

.pt-entering .pt-filters-row {
  animation: pt-drop 500ms cubic-bezier(.2, .7, .2, 1) 340ms both;
}

.pt-entering .pt-table thead tr {
  animation: pt-fade 500ms cubic-bezier(.2, .7, .2, 1) 420ms both;
}

/* The rows drop in one after another, from their top edge, in Final v2's 1200px perspective (M2). The perspective sits on the
   rows' own container, as Final v2's does (page.html 221): one reaches only an element's own children, so on the table or on a
   wrapper above it the rows' tilt would stay flat. Its vanishing point is Final v2's too, not this tbody's own centre: the design's
   table is 476px high at 1440x900 (a 37px head and eight rows), so the point its rows are drawn towards, its centre, is 238px down,
   201px below its first row. This tbody holds a page of 50 rows, whose centre is 1375px down, and the first rows would tilt several
   times harder. The delay is set per row by cascadeDelay in portal.js: only a first page that arrives while the entrance plays has
   one, so a Load more after the entrance is not animated. */
#pt-rows {
  perspective: 1200px;
  perspective-origin: 50% 201px;
}

.pt-entering #pt-rows tr {
  animation: pt-drop 520ms cubic-bezier(.2, .7, .2, 1) var(--pt-delay, 0ms) both;
  transform-origin: 50% 0;
}

/* While the entrance plays the first page's bars stay hidden (Final v2 page.html 432: its bars show when the page is loading and the
   entrance is not playing). loadList builds them as it always did, and hides #pt-rows for a first page and never for a Load more,
   so this rule reaches only a first page's bars: a Load more's three still show under the visible rows, and under reduced motion
   there is no class and so no rule. It ends with the class, so a page still loading when the entrance ends shows its bars then. */
.pt-entering #pt-rows[hidden] + #pt-skeleton {
  display: none;
}

/* A bar row fades in when it is shown (M3). */
.pt-skeleton tr {
  animation: pt-fade 240ms ease-out both;
}

/* The drawer: the rail grows down, then each entry, its dot and the two sections come in on a 90 ms stagger (M4). The rail is
   one segment per row here, and every segment grows from its own top at the same moment. */
.pt-d-enter .pt-l-row::before,
.pt-d-enter .pt-l-day::before {
  animation: pt-tc-line 600ms cubic-bezier(.2, .8, .2, 1) 60ms both;
  transform-origin: top;
}

.pt-d-enter .pt-l-row {
  animation: pt-tc-in 320ms cubic-bezier(.2, .8, .2, 1) var(--pt-delay, 0ms) both;
}

.pt-d-enter .pt-l-dot {
  animation: pt-tc-pop 260ms cubic-bezier(.2, .8, .2, 1) calc(var(--pt-delay, 0ms) + 40ms) both;
}

.pt-d-enter .pt-d-section {
  animation: pt-tc-in 320ms cubic-bezier(.2, .8, .2, 1) var(--pt-delay, 0ms) both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- States, Load more and the end of the list --------------------------- */

.pt-state {
  padding: 72px 0;
  text-align: center;
}

.pt-state-title {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.pt-state .pt-button {
  margin-top: 14px;
}

/* Load more under the rows, inside the scrolling list (spec 0208 v5 §5.2; Final v2 page.html 267–271). The margins are
   the button's, not the row's: once the button is hidden the row takes no room, so "That's every payment…" sits 22px
   under the rows as in the design, not 52px. */
.pt-more-row {
  display: flex;
  justify-content: center;
}

.pt-more {
  height: 36px;
  margin: 20px 0 32px;
  padding: 0 18px;
  border: 1px solid var(--color-border-strong);
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pt-more:hover:not(:disabled) {
  background: var(--color-row-hover);
}

.pt-more:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent);
}

/* While the next page loads: "Loading…", and a click does nothing. */
.pt-more:disabled {
  cursor: default;
  color: var(--color-text-muted);
}

/* "That's every payment for these filters." once next_cursor is null, the first page included (plan 2b, decision 3). */
.pt-all-loaded {
  margin: 22px 0 32px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ---- The header gives up room in Final v2's order: the picker's key, a staff user's email, a merchant's (page.html 410–412) ---- */

@media (max-width: 1399px) {
  .pt-picker-key {
    display: none;
  }
}

@media (max-width: 1259px) {
  .pt-app-staff .pt-who {
    display: none;
  }
}

@media (max-width: 1139px) {
  .pt-who {
    display: none;
  }
}

/* ---- The compact list: Reference, Amount and Outcome beside the drawer (Final v2 T16; spec 0208 v5.2 §6.2) ----

   portal.js puts pt-compact on the table while the drawer is open and the sheet's measured content width is under 780px (900px with a
   staff user's Merchant column): with the drawer at its 440px default that is a window under 1304px (1424px), where plan 2b's media
   queries switched; a wider drawer moves the threshold with it. The table's width floor goes with Customer. Reference takes the rest,
   and the :first-child and :last-child rules above reach the hidden Created and Environment cells, so Reference and Outcome carry the
   row's 8px of padding, the selected row's rounded ends and the keyboard ring instead. These rules tie the .pt-staff widths and
   `.pt-table.pt-staff` at (0,2,0) and win by order: the block stays after them. */

.pt-compact .pt-col-created,
.pt-compact td.pt-created-cell,
.pt-compact .pt-col-merchant,
.pt-compact td.pt-merchant-cell,
.pt-compact .pt-col-customer,
.pt-compact td.pt-customer,
.pt-compact .pt-col-env,
.pt-compact td.pt-env-cell {
  display: none;
}

.pt-table.pt-compact {
  min-width: 0;
}

.pt-compact .pt-col-ref { width: auto; }
.pt-compact .pt-col-amount { width: 128px; }
.pt-compact .pt-col-outcome { width: 156px; }
.pt-compact .pt-col-handle { display: none; }

.pt-compact .pt-col-ref,
.pt-compact td.pt-ref {
  padding-left: 8px;
}

.pt-compact .pt-col-outcome,
.pt-compact td.pt-outcome {
  padding-right: 8px;
}

.pt-compact #pt-rows tr[aria-selected="true"] td.pt-ref {
  border-radius: 8px 0 0 8px;
  box-shadow: inset 3px 0 0 var(--color-row-selected-bar);
}

.pt-compact #pt-rows tr[aria-selected="true"] td.pt-outcome {
  border-radius: 0 8px 8px 0;
}

.pt-compact #pt-rows tr:focus-visible td.pt-ref {
  box-shadow: inset 2px 2px 0 var(--color-accent), inset 0 -2px 0 var(--color-accent), inset 2px 0 0 var(--color-accent);
}

.pt-compact #pt-rows tr:focus-visible td.pt-outcome {
  box-shadow: inset -2px 2px 0 var(--color-accent), inset 0 -2px 0 var(--color-accent), inset -2px 0 0 var(--color-accent);
}

.pt-compact #pt-rows tr[aria-selected="true"]:focus-visible td.pt-ref {
  box-shadow: inset 3px 0 0 var(--color-row-selected-bar), inset 2px 2px 0 var(--color-accent), inset 0 -2px 0 var(--color-accent), inset 2px 0 0 var(--color-accent);
}

/* ---- Narrower windows (provisional; slice 2c designs the phone layout) ----- */

@media (max-width: 760px) {
  .pt-header {
    padding: 0 12px;
  }

  .pt-nav {
    display: none;
  }

  .pt-header-user {
    margin-left: 8px;
  }

  .pt-picker {
    max-width: 150px;
  }

  .pt-ghost {
    margin-left: 4px;
  }

  /* The drawer covers the window here, so the sheet stays whole under it. */
  .pt-frame,
  .pt-drawer-open .pt-frame {
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
  }

  .pt-top {
    padding: 16px 16px 0;
  }

  /* The search takes the room left on its line, never less than its placeholder needs. */
  .pt-search {
    flex: 1 1 240px;
  }

  .pt-scroll {
    padding: 12px 16px 0;
  }

  .pt-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    width: auto;
    border-left: 0;
    border-radius: 0;
  }

  .pt-d-resize { display: none; }

  /* Settings: the nav goes above the page, and Account's panels stack. */
  .pt-settings-layout {
    display: block;
  }

  .pt-settings-layout > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0;
  }

  .pt-keys-c-store,
  .pt-keys-c-created {
    display: none;
  }

  .pt-settings-nav {
    position: static;
    width: auto;
    margin: 0 0 20px;
  }



  .pt-guide-cols {
    flex-direction: column-reverse;
  }

  .pt-guide-contents {
    position: static;
    width: auto;
    margin: 0 0 20px;
  }

}
