/*
 * P4 sign-in screen.
 *
 * This is the only stylesheet in the app that is served to an UNAUTHENTICATED
 * caller — netlify/edge-functions/auth.ts lets exactly this file, js/signin.js,
 * signin.html, the logo, the courier sprite and a few font subsets through its
 * gate, and nothing else. That constraint is why the page does not simply link
 * css/styles.css: pulling 218KB of app CSS would publish the whole design
 * system, every component class and every layout of the internal tool to anyone
 * who hits the URL. So the handful of things this page needs are restated here.
 *
 * The @font-face blocks below are COPIES of ones that live (or lived) in
 * css/styles.css, pointing at the same vendored files. If the type stack changes
 * there, change it here too. That duplication is the whole cost of keeping the
 * public surface small.
 *
 * WHAT IS NOT THE APP PALETTE, AND WHY. The app runs on the warm-neutral ground
 * (--bg #FAF8F5) with an orange accent ramp. This page keeps its own copper
 * palette (#B4633C on #F7F3EE / #F5EDE4) because the Libya map is drawn in it:
 * the district fills, the arcs, the pulses and the courier are all tuned to that
 * ground, and re-paletting the page to --o-* would mean redrawing the map. The
 * hexes are therefore local to this file on purpose. Don't spread them.
 */

/* ===========================================================================
 * Type.
 *
 * The sans stack mirrors css/styles.css's --font-sans.
 *
 * IBM PLEX MONO IS BACK, ON THIS PAGE ONLY. DATA-50 removed it app-wide — one
 * typeface for every word and figure, with tabular-nums doing the column-
 * alignment job the mono face used to — and left the vendored files on disk
 * "so this pass is a one-line revert if the numerals turn out to need the mono
 * texture after all". This is not that revert. Nothing here is a figure in a
 * column; the mono sets five micro-labels (the eyebrow, the INTERNAL pill, the
 * SSO line, the env pill, the version) where the point IS the texture — it is
 * what makes them read as system chrome rather than as copy.
 *
 * That keeps DATA-50 intact where it was aimed: the app. If you find yourself
 * wanting --p4-mono on a number, use tabular figures instead.
 *
 * 400 and 600, LATIN ONLY. Everything set in mono here is ASCII plus the middot
 * (U+00B7), which is inside the latin subset — the latin-ext files stay
 * unreferenced, and stay off the gate's public allowlist with them.
 * ======================================================================== */
@font-face {
  font-family: 'P4 Sans';
  font-style: normal;
  font-weight: 400;
  size-adjust: 106%;
  src: local('AvenirNext-Regular'), local('Avenir Next Regular'), local('Avenir-Book');
}
@font-face {
  font-family: 'P4 Sans';
  font-style: normal;
  font-weight: 500;
  size-adjust: 106%;
  src: local('AvenirNext-Medium'), local('Avenir Next Medium'), local('Avenir-Medium');
}
@font-face {
  font-family: 'P4 Sans';
  font-style: normal;
  font-weight: 600;
  size-adjust: 106%;
  src: local('AvenirNext-DemiBold'), local('Avenir Next Demi Bold'), local('Avenir-Black');
}
@font-face {
  font-family: 'P4 Sans';
  font-style: normal;
  font-weight: 700;
  size-adjust: 106%;
  src: local('AvenirNext-Bold'), local('Avenir Next Bold'), local('Avenir-Heavy');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter/inter-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter/inter-variable-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/plex-mono/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/plex-mono/ibm-plex-mono-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --p4-sans: 'P4 Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --p4-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Neutrals come from tokens.css now — signin.html loads it ahead of this
   * file, and it is on the auth gate's public allowlist so it resolves for
   * callers with no account. The --p4-* names stay as the local vocabulary;
   * only what they point at changed. */
  --p4-ink: var(--on-surface);           /* was #1A1614 */
  --p4-body: var(--on-surface-variant);  /* was #6B6058 */
  --p4-line: var(--outline-variant);     /* was #E8DED2 */
  /* Brand. These were still the pre-Cortex copper after DATA-66, which only
   * migrated the neutrals here — so the page ran two oranges at once: an
   * #BF501A button beside a #B4633C pill. Both now come from --primary.
   *
   * --p4-copper-ink is --primary-ink rather than --primary because everything
   * that uses it is small text (the eyebrow, the support link, the INTERNAL
   * pill): --primary is 2.86:1 on white, --primary-ink is 4.80:1. */
  --p4-copper: var(--primary);
  --p4-copper-deep: var(--primary-ink);
  --p4-copper-ink: var(--primary-ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--surface-container-lowest); }
a { color: var(--p4-body); text-decoration: none; }

/* ===========================================================================
 * Shell
 * ======================================================================== */
.p4-shell {
  display: grid;
  grid-template-columns: minmax(520px, 42fr) 58fr;
  min-height: 100vh;
  height: 100vh;
  background: var(--surface-container-lowest);
  font-family: var(--p4-sans);
  color: var(--p4-ink);
  -webkit-font-smoothing: antialiased;
}

/* ===========================================================================
 * Left — the auth panel
 * ======================================================================== */
.p4-left {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 36px 64px 24px;
  border-right: 1px solid var(--p4-line);
  /* --surface, not the page ground. The form is the FIGURE and the map is the
   * field it sits on; when both panels were --surface-container-lowest the
   * split was carried entirely by a 1px rule and the page read as one flat
   * sheet with a line down it. */
  /* Flattened from a 3-stop wash (#FCF9F5 / #F7F3EE / #F4EEE7). Cortex has one
   * surface step at this lightness, not three, so the gradient had nowhere to
   * go — and three near-identical stops were carrying almost no signal. */
  background: var(--surface);
}
.p4-left::before,
.p4-left::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
/*
 * Ambient warmth in two corners. Halved from 11%/7% and pushed further off the
 * edge: these were tuned against a warm sand ground, and --primary is both
 * more saturated than the copper they were drawn with AND now sits on white,
 * so the same values read as pink smudges rather than as ambience. The job is
 * to keep the panel from being clinically flat, not to be seen.
 */
.p4-left::before {
  width: 620px; height: 620px; top: -300px; left: -260px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 6%, transparent) 0%, transparent 66%);
}
.p4-left::after {
  width: 480px; height: 480px; bottom: -250px; right: -210px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 4%, transparent) 0%, transparent 68%);
}
.p4-left > * { position: relative; z-index: 1; }

/* ===========================================================================
 * The lockup.
 *
 * One unit, not three widgets. The mark sits directly on the ground — the white
 * rounded tile it used to live in read as a favicon pasted next to a word, and
 * boxing an icon that already has its own silhouette adds a second shape for no
 * information. The old vertical-bar separator is gone for the same reason:
 * spacing separates these two things perfectly well, and the bar was a third
 * mark competing with the two that mean something.
 *
 * The mark is 30px against a 19px wordmark. align-items:center is optically
 * right here rather than merely arithmetically right, because the P4 glyph is a
 * centred cluster with no ascender or descender to pull its mass off-centre.
 * ======================================================================== */
.p4-brand { display: flex; align-items: center; }
.p4-brand-mark { display: block; width: 30px; height: 30px; flex: none; }
.p4-brand-name {
  font-size: 19px; font-weight: 600; letter-spacing: -.02em;
  margin-left: 11px;
}
/* Clear space where the bar used to be. */
.p4-chip {
  margin-left: 20px;
  font-family: var(--p4-mono);
  font-size: 9px; font-weight: 500; line-height: 1;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--p4-copper);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 999px;
  padding: 4px 8px 3px;
}

.p4-main { flex: 1; display: flex; align-items: center; min-height: 0; }
.p4-card { width: 100%; max-width: 404px; padding: 34px 0; }

.p4-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--p4-mono);
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--p4-copper-ink);
  margin-bottom: 18px;
}
.p4-eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; opacity: .5; }

.p4-title {
  font-size: 40px; font-weight: 700; line-height: 1.04;
  letter-spacing: -.032em; margin: 0 0 12px;
}
.p4-sub {
  font-size: 14.5px; line-height: 1.6; color: var(--p4-body);
  margin: 0 0 26px; max-width: 33ch; text-wrap: pretty;
}

/* ===========================================================================
 * Notices — the bounced-back auth error, and the gate-not-answering warning.
 * Both hidden until js/signin.js has a reason to show one.
 * ======================================================================== */
.p4-alert {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px; padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}
.p4-alert[hidden] { display: none; }
.p4-alert svg { flex: none; margin-top: 1px; }
.p4-alert span { font-size: 12.5px; line-height: 1.45; color: var(--p4-body); }

/* Neutral rather than copper: "no gate here" is a state, not a rejection. It
 * also sits BELOW the button, hence the top margin. */
.p4-alert--warn {
  border-color: var(--outline);
  background: color-mix(in srgb, var(--on-surface) 4%, transparent);
  margin-top: 20px;
}
.p4-alert--warn a { color: var(--p4-copper-ink); border-bottom: 1px solid color-mix(in srgb, var(--primary-ink) 32%, transparent); }

/* ===========================================================================
 * The one control on the page.
 *
 * Google-only should read as the sanctioned way in, not as the leftover after
 * the other options were deleted. So the button takes the full content column
 * at 60px, carries a copper gradient and a copper-tinted shadow, and lifts on
 * hover — the presence a primary action earns when it is the ONLY action.
 *
 * The white tile behind the G is gone. A white chip on a coloured button is the
 * shape of a third-party badge bolted on; the mark sits on the copper directly,
 * at 20px, with the button's own padding giving it room.
 *
 * ON THE LIGHTER COPPER, AND WHAT IT COSTS. The gradient has been lightened
 * twice, both times Yahya's call: #B4633C -> #A55834 originally, then
 * #BE6D46 -> #AC5C38, now #C97D53 -> #B76B42. The second pass was for the
 * four-colour G — it sits on the copper with no white chip behind it, and the
 * darker the ground, the more the blue and the green sink into it. A lighter
 * ground is what separates the mark, so the mark is the thing this value is
 * tuned for.
 *
 * White on the top stop measures 4.39:1 originally, 3.84:1 after the first
 * lightening, 3.21:1 now, against a 4.5:1 floor. The label is 15.5px/600,
 * which is not "large text" by WCAG, so it wants 4.5 and has not had it since
 * the first pass.
 *
 * Left as asked rather than quietly overridden, because this is a deliberate
 * look on an internal tool used by a handful of named people. If it ever needs
 * to pass: bumping .p4-g-label to 19px/700 makes it large text, where the
 * threshold drops to 3:1 and 3.21 clears it — just. Below this copper there is
 * no headroom left for that trick, so treat #C97D53 as the lightest the button
 * goes while the label stays white.
 * ======================================================================== */
.p4-g {
  display: flex; align-items: center; gap: 14px;
  width: 100%; height: 60px; padding: 0 20px;
  border: none; border-radius: 14px;
  /* Flattened from a 2-stop copper gradient (#C97D53 / #B76B42).
   * --primary-ink rather than --primary: this button's label is white at
   * 15.5px, which is 2.86:1 on --primary and 4.80:1 on --primary-ink. */
  background: var(--primary-ink);
  color: var(--on-primary);
  font-family: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: -.008em;
  text-decoration: none;
  cursor: pointer;
  /* A close resting shadow, not a bloom. The 24px cast at 40% was drawn for a
   * mid-tone copper gradient; under a solid --primary-ink it turned the one
   * heavy element on a very light page into a glowing one. The button should
   * carry weight because it is the only action here, not because it is lit. */
  box-shadow: 0 1px 2px color-mix(in srgb, var(--primary-ink) 16%, transparent),
              0 6px 16px -8px color-mix(in srgb, var(--primary-ink) 30%, transparent);
  transition: transform 140ms ease, box-shadow 220ms ease, background-color 140ms ease;
}
.p4-g:hover {
  transform: translateY(-1px);
  /* Warms toward --primary on hover rather than growing its shadow: the label
   * is white, so the fill can only lighten as far as contrast allows. Measured:
   * 12% lands on 4.49:1 and misses by a hundredth, 10% gives 4.54:1. */
  background: color-mix(in srgb, var(--primary) 10%, var(--primary-ink));
  box-shadow: 0 2px 5px color-mix(in srgb, var(--primary-ink) 20%, transparent),
              0 10px 22px -10px color-mix(in srgb, var(--primary-ink) 34%, transparent);
}
/* Settles flat — the button is being pressed INTO the page, so the lift and
 * most of the cast shadow go with it. */
.p4-g:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--primary-ink) 22%, transparent);
}
.p4-g:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 3px; }
.p4-g-ico { display: block; flex: none; }
.p4-g-label { flex: 1; text-align: left; }
.p4-g-arrow {
  flex: none; opacity: .8;
  transition: transform 180ms ease, opacity 180ms ease;
}
.p4-g:hover .p4-g-arrow { transform: translateX(3px); opacity: 1; }

/* --- the SSO footnote ---------------------------------------------------- *
 * A rule across the column, then one centred mono line. "SSO VIA PRESTO
 * WORKSPACE" states the mechanism; the previous "Presto Workspace accounts
 * only" stated a restriction, which is the same fact read as a limitation. */
.p4-sso { margin-top: 22px; }
.p4-sso-rule { height: 1px; margin: 0 0 14px; border: 0; background: var(--p4-line); }
.p4-sso-label {
  text-align: center;
  font-family: var(--p4-mono);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--p4-body);
}

.p4-feats {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none; padding: 0; margin: 32px 0 0;
}
.p4-feats li {
  font-size: 11.5px; line-height: 1.4; color: var(--p4-body);
  padding: 5px 11px;
  background: color-mix(in srgb, var(--on-surface) 3%, transparent);
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
}

/* ===========================================================================
 * Footer
 * ======================================================================== */
.p4-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--p4-line);
  font-size: 11px; color: var(--p4-body);
}
.p4-foot-side { display: flex; align-items: center; gap: 10px; flex: none; }
.p4-env, .p4-ver { font-family: var(--p4-mono); }
.p4-env {
  font-size: 9.5px; letter-spacing: .13em;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--p4-line); color: var(--p4-body); background: var(--surface);
}
.p4-ver { font-size: 10.5px; letter-spacing: .03em; }
.p4-support {
  font-size: 11.5px; white-space: nowrap;
  color: var(--p4-copper-ink);
  border-bottom: 1px solid color-mix(in srgb, var(--primary-ink) 32%, transparent);
  transition: color 140ms ease, border-color 140ms ease;
}
.p4-support:hover { color: var(--p4-copper); border-bottom-color: var(--p4-copper); }

/* ===========================================================================
 * Right — the Libya map.
 *
 * IT HAD WASHED OUT. The districts were #F0E2D4 on a #F5EDE4 panel, hairlines
 * at 0.5px, arcs at 16% opacity. On a good display in a dark room that is a
 * delicate map; on anything else it is an empty beige rectangle. What follows
 * is a contrast pass, not a redesign: same geometry, same palette family.
 *
 * WHERE THE LIFT COMES FROM — measure before retuning this.
 *
 *   Fill     #F0E2D4 -> #EFE3D6 -> #E0CDB8. The middle step was a NO-OP and is
 *            worth recording as one: against the #F5EDE4 panel the original
 *            measured 1.096:1 and #EFE3D6 measured 1.090:1, a hair LIGHTER, so
 *            it moved the fill fractionally the wrong way while looking like a
 *            fix. #E0CDB8 measures 1.33:1 — three times the separation, and
 *            still unmistakably a soft beige map rather than a data surface.
 *   Strokes  #DFCDB8 @0.5px -> #DFD0BE -> #D3BEA6 @0.75px. Half again as thick
 *            and darker: against the heavier fill the previous value had gone
 *            back to being a suggestion, and the districts are read by their
 *            edges before anything else.
 *   Arcs     16% copper -> #D9C6B2 at full strength. Were invisible, now texture.
 *   Pulses   flat 4px discs -> a 10px gradient bloom with a ring behind it.
 *
 * The fill and stroke themselves are presentation attributes on the <svg> root
 * in signin.html, so they inherit to all 22 paths; only the hover lives here.
 * ======================================================================== */
.p4-right {
  position: relative; overflow: hidden;
  background: var(--surface-container);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
  padding: 48px 48px 44px;
}
/* Paper grain. An inline SVG data: URI, which the site CSP allows under img-src. */
.p4-grain {
  position: absolute; inset: 0; pointer-events: none;
  opacity: .035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
/*
 * A LIGHT SOURCE. The map is one flat colour by construction — it is an
 * illustration, not a choropleth, so no district may look busier than another
 * or it starts implying data it does not have.
 *
 * Depth without implying data: a soft highlight from the top-left, drawn on the
 * PANEL behind the map rather than on any district. Every shape is still the
 * same fill; the field they sit in is what has form.
 */
.p4-right::before {
  content: '';
  position: absolute;
  width: 120%; height: 90%;
  top: -22%; left: -18%;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 32% 28%,
    color-mix(in srgb, var(--surface) 90%, transparent) 0%,
    transparent 62%
  );
}
.p4-map {
  position: relative;
  flex: 0 1 auto; min-height: 0;
  /* 720, not 640. The right panel is ~58% of a wide viewport and the map was
   * filling two-thirds of it, sitting small in a lot of air — this is the
   * page's one image and it should carry the panel. Still capped, so it never
   * crowds the caption or outgrows a short viewport. */
  width: 100%; max-width: 720px; max-height: calc(100vh - 158px);
  height: auto; display: block;
}
.p4-caption {
  position: relative; z-index: 2; text-align: center;
  font-family: var(--p4-mono);
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--p4-body);
}

/*
 * DISTRICT SEAMS. The migration left this map a single salmon slab: one fill,
 * one near-invisible seam, twenty-two shapes reading as one. The seam is set
 * on the <svg> in signin.html and was --heat-stop-dark at 30%, which on a
 * --heat-stop-light ground is barely a line.
 *
 * Raised to 55% here rather than in the markup so the map keeps ONE place that
 * decides its weight. At this strength the districts read individually and the
 * shape stops being a blob, without the seams becoming a net.
 */
.p4-map path.dist {
  transition: fill 220ms ease;
  stroke: color-mix(in srgb, var(--heat-stop-dark) 55%, transparent);
  vector-effect: non-scaling-stroke;
}
/* Darker than the fill, not lighter. When the fill moved to #E0CDB8 this had to
 * move with it — at #E5D5C0 the hover had become a LIGHTENING, which reads as
 * the district switching off rather than lighting up. */
.p4-map path.dist:hover { fill: color-mix(in srgb, var(--heat-stop-dark) 35%, var(--heat-stop-light)) }

/* Route arcs — texture, not signal. Visible enough to read as shipping lanes
 * across the empty sea, quiet enough not to compete with the pulses. */
.p4-map .arc {
  /* Slightly stronger than the fill it crosses: at --heat-stop-light on
   * --heat-stop-light the lanes had disappeared entirely. */
  stroke: color-mix(in srgb, var(--heat-stop-dark) 38%, transparent);
  stroke-dasharray: 8 14;
  animation: p4dash 14s linear infinite;
}
@keyframes p4dash { to { stroke-dashoffset: -320 } }

/*
 * PULSES. The nodes are pre-built by js/signin.js — a fixed pool of six, driven
 * by the Web Animations API rather than by CSS keyframes.
 *
 * Both halves of that are deliberate. The pool caps concurrency at six and
 * recycles, where the old code appended two fresh <circle>s per tick and let
 * setTimeout clean up after — unbounded by construction, and on a login screen
 * left open all afternoon that is thousands of nodes. And WAAPI restarts an
 * animation on demand (`el.animate(...)` from the top), where reusing a CSS
 * animation needs the remove-class-force-reflow-re-add dance.
 *
 * These are decorative. They are NOT real orders and must never be wired to
 * any, on a page that is served before anyone has signed in.
 */
.p4-map .pr, .p4-map .pd { transform-box: fill-box; transform-origin: center; opacity: 0 }

/* Pointer trail, under the courier. */
@keyframes p4trail {
  0%   { opacity: .55; transform: scale(1) }
  100% { opacity: 0; transform: scale(.15) }
}
@keyframes p4seg {
  0%   { opacity: .38 }
  100% { opacity: 0 }
}
.p4-map .tp { transform-box: fill-box; transform-origin: center; animation: p4trail 900ms cubic-bezier(.3,.7,.3,1) forwards }
.p4-map .ts { animation: p4seg 900ms cubic-bezier(.3,.7,.3,1) forwards }

/* ===========================================================================
 * The courier.
 *
 * A real element that follows the pointer, not `cursor: url(...)`. The CSS
 * cursor could only ever be as good as the platform's cursor pipeline — it
 * snaps to the OS cursor's update rate, silently caps its own size, and gives
 * you no hook for a fade — and on this build it was not reliably painting at
 * all. An absolutely-positioned <img> tracking pointer coordinates is fully
 * under our control.
 *
 * NO TRANSITION, ON ANYTHING. Position is 1:1 with the pointer, and the marker
 * now appears and disappears outright on the map's boundary rather than fading.
 * It had a 150ms/200ms opacity fade; on a boundary you cross deliberately that
 * reads as lag, and on the way out it leaves a courier hanging over the map
 * after the pointer has gone. A cursor stand-in should behave like a cursor.
 *
 * A transition on the transform would be worse still — the marker would trail
 * the pointer it is standing in for, which reads as dropped frames.
 *
 * pointer-events:none is load-bearing: without it the marker sits under the
 * cursor, swallows the district hovers and mouseleave-loops against itself.
 * ======================================================================== */
.p4-courier {
  position: absolute;
  top: 0; left: 0;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;      /* centre the sprite on the pointer */
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  will-change: transform;
}
.p4-courier--on { opacity: 1 }

/* Applied by JS, never in the base rule: if signin.js fails to load, the map
 * must still have a normal cursor rather than none at all. */
.p4-map--courier { cursor: none }

/* ===========================================================================
 * Responsive / motion
 * ======================================================================== */
@media (max-width: 980px) {
  .p4-shell { grid-template-columns: 1fr; height: auto; }
  .p4-left {
    min-height: 100vh; padding: 32px 28px 22px;
    border-right: none; border-bottom: 1px solid var(--p4-line);
  }
  .p4-title { font-size: 34px; }
  .p4-right { min-height: 60vh; }
}

/*
 * Reduced motion: the courier STAYS — it is a pointer indicator, not an
 * animation, and removing it would take away the one piece of feedback the map
 * gives. It needs no accommodation of its own any more either: it appears and
 * disappears outright at every setting now, so there is no fade left to drop.
 * What goes here is everything that moves on its own — the arc dash, and the
 * pulses and trail, which signin.js simply never starts.
 *
 * The arcs stay VISIBLE, unlike the previous rule which set opacity:0 on them.
 * They are texture in the composition; holding them still is the accommodation,
 * deleting them is a different layout.
 */
@media (prefers-reduced-motion: reduce) {
  .p4-g, .p4-g-arrow, .p4-support { transition: none }
  /* The courier needs no rule here any more — it has no transition to drop. */
  .p4-map .arc { animation: none }
}
