/*
 * The Pielyt admin screens, in Pielyt's own language.
 *
 * WHERE THE VALUES COME FROM. `components/brand/tokens.ts` and
 * `design-ref/pielyt-homepage.html`, summarised in `components/console2/DESIGN.md`
 * under "Design direction": cream ground, paper cards, warm near-black ink, one
 * terracotta accent, bold tight headings, hairline warm borders, generous
 * radius, full-round buttons, and almost no shadow. The hex values are copied
 * here rather than imported because a WordPress plugin cannot read a TypeScript
 * module; that copy is the cost of the page looking like the product, and it is
 * a small closed set that changes about once a year.
 *
 * CREAM GROUND, PAPER CARDS — the design direction taken literally, 2026-09-03.
 * It used to be one 60em-wide paper panel with every section stacked inside it,
 * and the owner read that as the sections "sitting on the background" with the
 * screen's whole right-hand side wasted. They were right on both counts: nothing
 * separated one section from the next, and a 60em clamp on a 1440px screen threw
 * away half the content column. So the wrapper is the CREAM ground now, filling
 * the content area edge to edge, and each section is a PAPER card laid out
 * across it — which is the two-surface language the product already speaks and
 * the reason those two tokens existed before anything drew them.
 *
 * THE GRID COUNTS ITSELF. `.pielyt-panes` is `repeat(auto-fit, minmax(...))`
 * rather than a column count behind media queries, because the thing that varies
 * is the CONTENT COLUMN and not the viewport: wp-admin's menu is 160px wide,
 * 36px folded, and gone under 783px, so the same 1024px window gives three
 * different widths to lay out in. `auto-fit` measures what is actually there and
 * collapses to one column when a second will not fit, with no breakpoint to keep
 * in step. The activity screen opts out (`--stacked`) because both its sections
 * are four-column tables of history, and half the width would wrap every cell.
 *
 * NOT AN EXTERNAL REQUEST, ANYWHERE IN THIS FILE. wordpress.org guideline 7
 * covers what a plugin fetches, and a stylesheet fetches things too — a webfont,
 * a background image, an `@import`. There is no `url()` in this file pointing
 * anywhere, and `scripts/plugin-disclosure-gate.mjs` fails on one, because the
 * gate that reads outbound calls reads PHP and would never have seen it. The one
 * `url()` below is a `data:` URI of core's own checkmark, which fetches nothing.
 *
 * THE FONT IS A STACK, NOT A FILE. The product is set in Figtree. Serving it
 * would mean either a Google Fonts request — forbidden above and by guideline 7
 * — or shipping a woff2 in the plugin zip, which is weight and an OFL notice on
 * every install for one admin screen. So: Figtree if the reader already has it,
 * and wp-admin's own system stack otherwise, which is what the rest of their
 * dashboard is set in. The page reads as Pielyt through colour, weight, spacing
 * and shape, none of which need the typeface to arrive.
 *
 * SCOPED, BECAUSE WP-ADMIN OWNS THE CHROME. Every selector sits under
 * `.pielyt-admin`, the wrapper both screens print, and the stylesheet is
 * enqueued on those two screens' hooks and nowhere else (`Admin::styles()` and
 * `Activity::styles()`, each comparing `===` against its own). Nothing here can
 * reach the admin menu, the toolbar, or another plugin's screen.
 *
 * IT REACHES THE ACTIVITY SCREEN ON PURPOSE NOW, and until 2026-09-03 it could
 * not: that screen enqueued nothing at all and drew four outcome chips from an
 * inline `<style>`, so it rendered in wp-admin's grey beside a settings screen
 * in Pielyt's colours. That was half of what the owner meant by the plugin
 * having "lost all its styling". The chips are `.pielyt-outcome` below.
 *
 * `css/` AND NOT `assets/`, which is the name a WordPress plugin usually gives
 * this. `.wordpress-org/assets` is the listing's screenshots and
 * `scripts/screenshots-gate.mjs` refuses a `plugin/assets/` outright, to stop
 * the two ever being one directory. Its comment predicted this file's arrival
 * by name.
 *
 * RESTYLED, NOT REPLACED. The checkboxes are WordPress's checkboxes, the submit
 * button is `submit_button()`'s, the notices are core's `.notice`. They keep
 * their markup, their behaviour, their keyboard handling and their semantics;
 * this file changes what they look like and nothing else. Core's one colour-only
 * signal — the status rule down a notice's left edge — is the exception, and it
 * is DROPPED rather than kept: see `.pielyt-admin .pielyt-card > .notice` below
 * for why, and `scripts/plugin-style-gate.mjs` for what holds it.
 */

.pielyt-admin {
	/* Grounds */
	--wpa-cream: #f1e3d0;
	--wpa-paper: #fbf3e7;
	--wpa-paper-faint: #faf8f3;

	/* Ink, darkest to lightest */
	--wpa-ink: #1a1712;
	--wpa-ink-soft: #3a352c;
	--wpa-ink-muted: #5c5346;
	/*
	 * #8c8271 in components/brand/tokens.ts, and it fails WCAG AA here: 3.44:1
	 * on paper, where it carries every word of explanatory copy on the screen at
	 * 13px. Core's own `.description` is 4.91:1, so the brand value would have
	 * been a REGRESSION against the thing it replaced. Darkened to the nearest
	 * value clearing 4.5:1 on all three grounds (paper 5.45, paper-faint 5.65,
	 * cream 4.75) rather than shipping the token unchanged and unreadable.
	 */
	--wpa-ink-faint: #6b6254;

	/* The one accent */
	--wpa-terracotta: #b4462f;
	--wpa-on-terracotta: #fff6ea;
	--wpa-on-ink: #f6eee1;

	/* Structure */
	--wpa-border: #e6d4b9;
	--wpa-border-soft: rgba(26, 23, 18, 0.08);

	/*
	 * The four outcome tones, for the activity screen's chips. Every pair clears
	 * 4.5:1 (good 7.47, warn 6.88, danger 6.78, neutral 7.86), and none of them
	 * is the only carrier of its meaning — the chip says "Carried out" or
	 * "Refused" in words, which is what WCAG 1.4.1 actually asks. They replace
	 * core's greens and greys, which were the one cold thing left on either
	 * screen.
	 */
	--wpa-good-bg: #e4efdc;
	--wpa-good-ink: #2c5320;
	--wpa-warn-bg: #f7ecd0;
	--wpa-warn-ink: #6a4a06;
	--wpa-danger-bg: #f7e3dd;
	--wpa-danger-ink: #8a2f1c;
	--wpa-neutral-bg: #efe7d8;
	--wpa-neutral-ink: #4a4437;

	--wpa-font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

	/*
	 * NO `max-width`, AND CORE'S `.wrap` MARGIN REPLACED RATHER THAN KEPT.
	 *
	 * Core sets `.wrap { margin: 10px 20px 0 2px }`, which leaves a grey gutter
	 * down both sides of anything painted here. Overriding it lets the cream
	 * reach the width of the content column whatever the cards inside it
	 * measure, so the screen reads as a Pielyt page inside wp-admin rather than
	 * as a beige box floating on wp-admin's grey — and it stays full width on a
	 * screen the cards do not fill, which is the case that made the old margin
	 * look like a mistake. The 60em clamp that used to sit here is gone; what
	 * keeps prose readable is a measure on the paragraph (`p { max-width }`) and
	 * the card it sits in, which is where a measure belongs — on the text, not
	 * on the page.
	 *
	 * A SHEET, WITH ONE ROUNDED CORNER — 2026-09-07 (wp-e10zd), the owner's
	 * shape and not an invention: full width, "just enough margin for a tiny
	 * shadow, and a rounded corner on ONLY the bottom-left". So the ground keeps
	 * its two flush edges — the top, where it meets the admin header, and the
	 * left, where it meets the admin menu — and takes a small margin on the
	 * right and the bottom, which are the two sides a downward shadow falls on.
	 * The bottom-left is the only corner where the sheet leaves the menu, and it
	 * is the one that rounds. The shadow is a quarter of the strength the cards
	 * carry: this is a ground, and a ground that appears to hover reads as a
	 * card the cards are sitting on rather than as the page they are laid out
	 * across.
	 */
	margin: 0 12px 14px 0;
	padding: 1.75rem 1.75rem 3rem;
	background: var(--wpa-cream);
	border-radius: 0 0 0 24px;
	box-shadow: 0 1px 2px rgba(26, 23, 18, 0.05), 0 10px 20px -16px rgba(26, 23, 18, 0.3);
	font-family: var(--wpa-font);
	color: var(--wpa-ink-muted);
	font-size: 14px;
	line-height: 1.6;
}

/* ------------------------------------------------------- masthead and grid */

.pielyt-admin .pielyt-masthead {
	margin: 0 0 1.4rem;
}

.pielyt-admin .pielyt-panes {
	display: grid;
	/*
	 * ROW GAP WIDER THAN COLUMN GAP, AND BOTH WIDER THAN THEY WERE — 2026-09-07
	 * (wp-e10zd). One 1.25rem figure used to serve both, and on the live page
	 * the owner read the result as cards with no space between them at all:
	 * "'Not connected' and 'What this site allows' smash into the top card."
	 * 20px was in fact there, and that is the point — it was SMALLER than the
	 * 1.75rem the cards are padded with and smaller than the page's own gutter,
	 * so the only distance on the screen that says "these are separate objects"
	 * was the tightest one on it. Two cards a hair apart do not read as two
	 * cards; they read as one card with a seam.
	 *
	 * Vertical and horizontal are not the same distance because they are not
	 * doing the same job. Side by side, the cards' own edges and the ground
	 * between them already separate two columns of one row. Stacked, nothing
	 * separates the bottom of one card from the top of the next except this,
	 * and the lower card's rounded top corners eat into it visually before a
	 * reader ever sees it.
	 */
	gap: 2rem 1.5rem;
	/*
	 * `start`, so a short card beside a tall one is a short card and not a tall
	 * card with a hole in it. This is the whole reason the two panes can differ
	 * in height without the layout looking broken.
	 */
	align-items: start;
	/*
	 * `min(100%, 30em)` and not a bare `30em`: `minmax` with a floor wider than
	 * the container overflows it rather than collapsing, which is the one way an
	 * `auto-fit` grid can be worse than a fixed column count. With `min()` the
	 * floor is never larger than the space there is, so the narrow case is one
	 * full-width column and nothing sticks out.
	 */
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 30em), 1fr));
}

.pielyt-admin .pielyt-panes--stacked {
	grid-template-columns: minmax(0, 1fr);
}

/* ------------------------------------------------------------------- cards */

.pielyt-admin .pielyt-card {
	padding: 1.5em 1.75em 1.75em;
	background: var(--wpa-paper);
	border: 1px solid var(--wpa-border);
	border-radius: 20px;
	/*
	 * SOFT, AND VISIBLE — RAISED 2026-09-06 (wp-5avdv). The design direction's own
	 * phrase was "almost no shadow", and the first cut of this took that close to
	 * literally: at 0.03/0.28 alpha the shadow all but disappeared against a
	 * ground that is only 1.15:1 off the card's own paper, and the owner read the
	 * live page as flat. `pielyt-homepage.html`'s own paper cards carry a much
	 * bolder version of this same two-part shape — a hairline contact shadow plus
	 * a long soft one lifting the card off the page, in this same warm-ink colour
	 * — sized for a ~1420px hero panel (`0 26px 50px -40px rgba(26,23,18,.5)`).
	 * These cards run 500–700px, roughly 40% that width, so the geometry is
	 * scaled down with it rather than copied at hero size, which on a card this
	 * size would read as a glow. The colour and the two-part shape are the
	 * reference's; only the offset, blur and spread are resized for what they are
	 * lifting.
	 */
	box-shadow: 0 1px 2px rgba(26, 23, 18, 0.05), 0 12px 24px -16px rgba(26, 23, 18, 0.35);
}

/*
 * THE FULL-WIDTH ASIDES ARE NOT GRID ITEMS ANY MORE, 2026-09-06 (wp-5avdv).
 *
 * They used to live inside `.pielyt-panes` as `grid-column: 1 / -1`, which
 * looks like "span the whole row" and instead meant "touch every track
 * `auto-fit` generated" — and `auto-fit` only collapses a track that NO item
 * touches. A spanning item touches all of them, so none was ever collapsed,
 * and a wide window generates more 30em tracks than there are real cards to
 * fill: the two actual columns each got a shrinking one-track share while the
 * rest of the row sat empty on the right, invisible and unreachable. That
 * measured as cards getting NARROWER as the window got WIDER (592px at
 * 1440px, 548px at 1920px, 526px at 2400px) — the opposite of "full width",
 * and the cause of both halves of the owner's report: the page not reaching
 * the edge, and the cards not being as wide as they could be.
 *
 * `Admin::render()` now prints the disclosure before `.pielyt-panes` opens
 * and the review prompt after it closes, so neither is a grid item and
 * `.pielyt-panes` only ever contains the cards that are genuinely columns of
 * it. `auto-fit` can do its own job on an honest track count. What is left
 * here is only the gap the grid used to supply on either side of a wide
 * card — the same 2rem row gap the grid gives every other stacked pair, kept
 * one-directional (bottom before the grid, top after it) so it does not
 * double up with the masthead's own margin when the disclosure is the first
 * thing on the page.
 */
.pielyt-admin .pielyt-card--wide + .pielyt-panes,
.pielyt-admin .pielyt-panes + .pielyt-card--wide {
	margin-top: 2rem;
}

.pielyt-admin .pielyt-card > :first-child {
	margin-top: 0;
}

.pielyt-admin .pielyt-card > :last-child {
	margin-bottom: 0;
}

/*
 * A notice that is a card's whole content does not need a second box inside the
 * first. The card already is the frame, so the frame goes.
 *
 * AND SO DOES THE STATUS RULE, 2026-09-07 (wp-e10zd). This rule used to keep
 * core's 4px left border and drop the other three — `border-width: 0 0 0 4px` —
 * on the reasoning that the colour of that rule is core's way of saying what
 * kind of notice this is. It is the third time the owner has had to report the
 * result: "THERE ARE STILL THESE STUPID CARD BORDERS ON ONLY THE LEFT SIDE OF
 * THE CARD. PLEASE **NEVER** DO THIS." He is right, and the reasoning was
 * wrong twice over. A border is a claim about where a box ends; this one made
 * it on one edge and abandoned it on the other three, so the review ask read as
 * an unfinished frame rather than a deliberate mark. And the status was never
 * carried by it anyway — the sentence inside says what it is ("Pielyt working
 * well here?" reads nothing like a warning), which is what WCAG 1.4.1 asks for
 * and what `.pielyt-admin .notice` below already relies on for every other
 * notice on either screen.
 *
 * `scripts/plugin-style-gate.mjs` is what stops it coming back a fourth time.
 * Two removals by hand have not held; a gate that refuses a border on one side
 * alone, in this stylesheet and in the plugin's markup, is the part of this fix
 * that is not just another edit.
 */
.pielyt-admin .pielyt-card > .notice:only-child {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
}

/* ---------------------------------------------------------------- headings */

.pielyt-admin h1,
.pielyt-admin h2,
.pielyt-admin h3 {
	color: var(--wpa-ink);
	font-family: var(--wpa-font);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.pielyt-admin h1 {
	margin: 0;
	padding: 0;
	font-size: 32px;
	line-height: 1.15;
}

/* The tagline under the wordmark (wp-9rwz) — weight, not the h1's, carries
   the distinction; the colour is the same muted ink every secondary line on
   this screen already reads in. */
.pielyt-admin .pielyt-tagline {
	margin: 0.3em 0 0;
	color: var(--wpa-ink-muted);
	font-family: var(--wpa-font);
	font-size: 14px;
	font-weight: 400;
}

.pielyt-admin h2 {
	margin: 1.8em 0 0.5em;
	font-size: 19px;
}

.pielyt-admin h3 {
	margin: 1.6em 0 0.5em;
	font-size: 15px;
}

.pielyt-admin p {
	margin: 0 0 1em;
	/*
	 * The measure, and it is on the paragraph now rather than on the page. A
	 * card in a two-column grid is already narrower than this; a card on the
	 * full-width row is wider, and this is what stops its one sentence running
	 * the length of a 4K screen.
	 */
	max-width: 44em;
}

.pielyt-admin p.description,
.pielyt-admin span.description {
	color: var(--wpa-ink-faint);
	font-size: 13px;
	font-style: normal;
}

.pielyt-admin a {
	color: var(--wpa-terracotta);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.pielyt-admin a:hover,
.pielyt-admin a:focus {
	color: var(--wpa-ink);
}

.pielyt-admin code {
	padding: 2px 6px;
	background: var(--wpa-paper-faint);
	border: 1px solid var(--wpa-border-soft);
	border-radius: 6px;
	color: var(--wpa-ink-soft);
	font-size: 12px;
	/*
	 * A refusal code is one unbroken identifier — `switch_no_user_management` —
	 * and the activity screen prints it inside the narrowest column of a
	 * four-column table. With nothing said here it does not wrap at all: at
	 * 768px it ran straight out of its cell and over the card's edge, which the
	 * screenshot caught. `anywhere` rather than `break-word` because there is no
	 * break opportunity in the string to prefer.
	 */
	overflow-wrap: anywhere;
}

/* ----------------------------------------------------------------- buttons */

/*
 * Three weights, and the first two are the console's own split (DESIGN.md):
 * terracotta is the action taken INSIDE this screen (Save changes), ink is the
 * way OUT of it (Connect this site, which leaves for Pielyt and comes back).
 * Everything else is the quiet paper pill. All of them are full-round and flat
 * — `box-shadow: none` and `text-shadow: none`, because core draws both.
 *
 * NO ELEMENT SELECTORS IN THIS LIST. It carried `button.button` once, which is
 * one specificity point above `.button-primary` and therefore beat it — so the
 * only `<button class="button button-primary">` on the page, Connect, rendered
 * as the quiet pill while the `<input>` beside it rendered terracotta. They
 * looked deliberately different and were not. Caught in the screenshot, which
 * is the argument for taking one.
 */
.pielyt-admin .button,
.pielyt-admin .button-primary,
.pielyt-admin .button-secondary {
	height: auto;
	padding: 0.55em 1.4em;
	border-radius: 999px;
	border: 1px solid var(--wpa-border);
	background: var(--wpa-paper-faint);
	color: var(--wpa-ink);
	font-family: var(--wpa-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	box-shadow: none;
	text-shadow: none;
}

.pielyt-admin .button:hover,
.pielyt-admin .button:focus {
	background: var(--wpa-cream);
	border-color: var(--wpa-ink-faint);
	color: var(--wpa-ink);
}

.pielyt-admin .button-primary,
.pielyt-admin .button-primary:hover,
.pielyt-admin .button-primary:focus {
	background: var(--wpa-terracotta);
	border-color: var(--wpa-terracotta);
	color: var(--wpa-on-terracotta);
}

.pielyt-admin .button-primary:hover,
.pielyt-admin .button-primary:focus {
	filter: brightness(0.92);
}

/* The quiet text button — "No thanks" on the review prompt. */
.pielyt-admin .button-link {
	color: var(--wpa-ink-faint);
	font-family: var(--wpa-font);
	font-size: 14px;
}

.pielyt-admin .button-link:hover,
.pielyt-admin .button-link:focus {
	color: var(--wpa-ink);
}

/*
 * Connect: the ink pill, and the one button on this screen that takes the
 * reader somewhere else. Addressed by id because there is exactly one of it and
 * the class it carries is the same class Save carries.
 */
.pielyt-admin #pielyt-connect,
.pielyt-admin #pielyt-connect:hover,
.pielyt-admin #pielyt-connect:focus {
	background: var(--wpa-ink);
	border-color: var(--wpa-ink);
	color: var(--wpa-on-ink);
}

/*
 * Disconnect. An outline in the accent reads as serious without shouting, and
 * it is the only place this page draws terracotta as a line rather than as a
 * ground.
 *
 * BOTH SPELLINGS, because core's is `delete` and not `button-delete`.
 * `submit_button( $text, 'delete' )` only prefixes the shorthand types
 * (`primary`, `small`, `large`); anything else is appended raw, so the real
 * markup is `class="button delete"`. This file was written against the unit
 * suite's stub, which emitted `button-delete`, and the rule below matched
 * nothing at all on a real install — visible only in the screenshot, where the
 * disconnect button came out as the quiet paper pill. The stub has been
 * corrected to core's spelling; both are kept here so the fix does not depend
 * on the stub being right a second time.
 */
.pielyt-admin .button.delete,
.pielyt-admin .button-delete {
	background: transparent;
	border-color: var(--wpa-terracotta);
	color: var(--wpa-terracotta);
}

.pielyt-admin .button.delete:hover,
.pielyt-admin .button.delete:focus,
.pielyt-admin .button-delete:hover,
.pielyt-admin .button-delete:focus {
	background: var(--wpa-terracotta);
	border-color: var(--wpa-terracotta);
	color: var(--wpa-on-terracotta);
}

.pielyt-admin p.submit {
	margin: 1.4em 0 0;
	padding: 0;
}

/* ------------------------------------------------------------------ tables */

.pielyt-admin .form-table,
.pielyt-admin .widefat {
	/* A bottom margin too: `p` sets no top one, so the activity link under the
	 * connected pane's table sat flush against its rounded bottom edge. */
	margin: 0.5em 0 1.2em;
	border: 1px solid var(--wpa-border);
	border-radius: 16px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	background: var(--wpa-paper-faint);
	box-shadow: none;
	/*
	 * `auto`, explicitly, because `.widefat` is `table-layout: fixed` in core.
	 * Fixed layout divides the width by the column hints and ignores what is in
	 * the cells, which was survivable in a 60em panel and is not in a card that
	 * narrows with the grid: the activity screen's `What happened` column would
	 * keep whatever share the fixed hints gave it while its neighbours sat half
	 * empty.
	 */
	table-layout: auto;
}

.pielyt-admin .form-table th,
.pielyt-admin .form-table td,
.pielyt-admin .widefat th,
.pielyt-admin .widefat td {
	padding: 1.1em 1.2em;
	border-bottom: 1px solid var(--wpa-border-soft);
	background: transparent;
	color: var(--wpa-ink-muted);
	font-family: var(--wpa-font);
	font-size: 14px;
	line-height: 1.6;
}

.pielyt-admin .form-table tr:last-child th,
.pielyt-admin .form-table tr:last-child td,
.pielyt-admin .widefat tbody tr:last-child th,
.pielyt-admin .widefat tbody tr:last-child td {
	border-bottom: 0;
}

.pielyt-admin .form-table th,
.pielyt-admin .widefat th {
	color: var(--wpa-ink);
	font-weight: 700;
}

/*
 * The label column, in `em` and in the stylesheet.
 *
 * It was `style="width:14em"` printed into the markup, and core's own
 * `.form-table th` is a flat `200px`. Both were written when every table on the
 * screen was the same width; inside a card that narrows with the grid an inline
 * width is the one declaration no rule here can reach, and 200px of a 30em card
 * is a third of it spent on a label.
 */
.pielyt-admin .form-table th,
.pielyt-admin .widefat th[scope="row"] {
	width: 11em;
}

/*
 * CORE'S OWN BREAKPOINT, AND THE WIDTH ABOVE HAS TO GIVE WAY AT IT.
 *
 * Under 783px wp-admin turns `.form-table` rows into stacked blocks — `th` and
 * `td` both `display: block; width: auto` — so the label sits above its control
 * instead of beside it. An 11em width on a block `th` leaves the row's hairline
 * running a third of the way across and stopping, which is what the 768px
 * screenshot showed: a rule under "Read only" that goes nowhere. The width goes,
 * and so does the `th`'s own bottom border, because at that size the label and
 * the control are one row and a line between them says they are two.
 */
@media screen and (max-width: 782px) {
	.pielyt-admin .form-table th,
	.pielyt-admin .widefat th[scope="row"] {
		width: auto;
	}

	.pielyt-admin .form-table th {
		padding-bottom: 0;
		border-bottom: 0;
	}
}

/*
 * THE ACTIVITY LOG'S FOUR COLUMNS.
 *
 * When and Who are datestamps and short names; Outcome holds a chip, a refusal
 * code that cannot be hyphenated, and a sentence about it. What happened takes
 * whatever is left, which is what an `auto` layout gives an unsized column.
 *
 * The numbers used to be inline `style="width:14em"` attributes in Activity.php,
 * and the last column's 10em was too narrow for what goes in it: the code broke
 * across two lines while the column to its left ran half empty, because an
 * inline width is a rule no stylesheet can answer. Here they can be tuned, and
 * they let go entirely on a narrow screen.
 */
.pielyt-admin .pielyt-log th:nth-child(1),
.pielyt-admin .pielyt-log th:nth-child(2) {
	width: 13em;
}

.pielyt-admin .pielyt-log th:nth-child(4) {
	width: 17em;
}

@media screen and (max-width: 782px) {
	.pielyt-admin .pielyt-log th {
		width: auto;
	}
}

/*
 * Core stripes `.striped` rows grey, which puts a cold band across a warm card.
 * The stripe goes rather than getting a warm colour of its own: the rows are
 * already separated by a hairline, and a second separator doing the same job in
 * two ways is what makes a table look busy. One surface, ruled.
 */
.pielyt-admin .widefat.striped > tbody > :nth-child(odd) {
	background: transparent;
}

.pielyt-admin .form-table td .description,
.pielyt-admin .form-table td p.description {
	margin: 0.4em 0 0;
	color: var(--wpa-ink-faint);
}

.pielyt-admin input[type="text"] {
	background: var(--wpa-paper-faint);
	border: 1px solid var(--wpa-border);
	border-radius: 10px;
	box-shadow: none;
	color: var(--wpa-ink-soft);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	padding: 0.5em 0.7em;
	/* The support identifiers are long and the card is not: let the field take
	 * the cell rather than core's fixed `.regular-text` 25em, which overflowed
	 * the card's rounded edge the moment the grid put it in a column. */
	max-width: 100%;
}

/*
 * The checkbox stays WordPress's checkbox — same element, same size, same
 * keyboard behaviour, and the same tick.
 *
 * Core sets `appearance: none` on it and draws the tick itself, as a dashicon
 * glyph in `:checked::before`. So `accent-color` does nothing here, and the
 * tempting `::before { content: none }` — which is what a first pass reaches
 * for when a tick looks wrong — would leave a checked box looking empty. What
 * is actually wanted is the glyph in the accent, which is one colour.
 *
 * THE FILL IS STATED IN BOTH STATES, and until 2026-09-08 neither was. Core
 * owned it, and what core paints there changed underneath this file — see the
 * `:checked` rule below. `--wpa-paper-faint` is not a new value: it is what
 * `input[type="text"]` above already sits on, and — measured on the rendered
 * page, not assumed — it is exactly what `.form-table` paints behind these
 * three boxes, so the box's ground and the page's ground are the same colour
 * and the 1px border is what says where the control is.
 */
.pielyt-admin input[type="checkbox"] {
	background-color: var(--wpa-paper-faint);
	border-color: var(--wpa-ink-faint);
	border-radius: 5px;
	box-shadow: none;
}

/*
 * THE CHECKED FILL, WHICH WAS WORDPRESS'S UNTIL 7.1 GAVE IT A COLOUR.
 *
 * WordPress 7.1 added, to `wp-admin/css/forms.css`, a rule that did not exist
 * in 6.9 — the version this plugin's e2e box is pinned to and the version every
 * screenshot here was taken on:
 *
 *     input[type="checkbox"]:checked {
 *         background: var(--wp-admin-theme-color);
 *         border-color: var(--wp-admin-theme-color);
 *     }
 *
 * A checked box stopped being white and became a solid block of the reader's
 * admin colour scheme — #3858e9 on the default one. Core moved its own tick to
 * white in the same release; this file's terracotta tick did not move, because
 * this file had no idea the ground under it had. The owner reported the result
 * on 2026-09-08 as an orange check on a dark blue background, and it is worse
 * than it sounds: measured off the rendered pixels at 16x on a real 7.1 box,
 * #b4462f on #3858e9 is 1.03:1. Not "hard to read" — the tick and the fill are
 * the same brightness, so the check is not there at all.
 *
 * This is the second time in this file that a checkbox rule was written against
 * a WordPress that had since changed (the first is recorded in the comment
 * below, which reasoned from a dashicon glyph five years after core stopped
 * drawing one). The lesson both times is the same: a declaration this file
 * leaves to core is a declaration core is free to change. So the fill is stated
 * here in both states rather than inherited in either.
 *
 * (0,3,1), where core's is (0,2,1), so it wins on specificity and not on which
 * stylesheet was enqueued second. It sits ABOVE the focus rule on purpose: that
 * rule is the same specificity and later in the file, so a checked box that
 * also has focus still takes the terracotta ring rather than this border —
 * which is the defect the focus block below exists to have fixed.
 *
 * AND THE TICK IS THE STATE, NOT THE COLOUR. Checked and unchecked are now the
 * same fill and the same border; what differs is the presence of a checkmark,
 * which is a shape. That is what WCAG 1.4.1 asks for, and it is the reason
 * `::before` below must keep drawing something. The tick reads at 5.13:1 on
 * this fill (measured, same method as above), against the 4.5:1 that text-sized
 * marks are held to; core's blue left it at 1.03:1.
 */
.pielyt-admin input[type="checkbox"]:checked {
	background-color: var(--wpa-paper-faint);
	border-color: var(--wpa-ink-faint);
}

/*
 * THE CHECKED TICK IS AN IMAGE, NOT A GLYPH, so `color` could never have
 * touched it. This rule said `color: var(--wpa-terracotta)` and was dead: since
 * 5.7 core draws the tick as `content: url("data:image/svg+xml…")` with
 * `fill='%233582c4'` baked into the markup (wp-admin/css/forms.css:175 in the
 * pinned 6.9.4, read to check rather than assumed). The comment that used to
 * sit here reasoned carefully from "a dashicon glyph", which stopped being true
 * five years before the WordPress this ships against.
 *
 * What actually works is replacing the image. This is core's own path data at
 * core's own size, in the one accent this page uses. If a later core changes
 * the glyph, this degrades to a correct checkmark rather than to nothing —
 * which is the reason to reuse the path rather than invent a shape.
 */
.pielyt-admin input[type="checkbox"]:checked::before {
	content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23b4462f%27%2F%3E%3C%2Fsvg%3E");
	/*
	 * DECLARED TWICE, WHICH IS CORE'S OWN PATTERN AND NOT A DUPLICATE. The
	 * `/ ''` is the alternative-text syntax: it tells assistive technology the
	 * image carries no information, which is right here because the checkbox
	 * already announces its own state and its label. A browser that does not
	 * support the syntax treats the whole declaration as invalid and drops it,
	 * so the plain one above must stay first -- without it, such a browser
	 * would show no tick at all.
	 *
	 * Core has written it this way since before 6.9 (wp-admin/css/forms.css,
	 * read out of the 6.9 and 7.1 images rather than assumed). This override
	 * replaces core's pair on specificity, so until now it was silently
	 * dropping the alt text on every version.
	 */
	content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23b4462f%27%2F%3E%3C%2Fsvg%3E") / '';
}

/*
 * FOCUS, PUT BACK. This is the defect in this file that mattered.
 *
 * Core's indicator is `input[type="checkbox"]:focus { border-color: #2271b1;
 * box-shadow: 0 0 0 1px #2271b1; outline: 2px solid transparent }` — specificity
 * (0,2,1). The rules above are `.pielyt-admin input[type="checkbox"]`, also
 * (0,2,1), and this stylesheet is enqueued after core's, so `box-shadow: none`
 * and a new `border-color` won on source order and cancelled BOTH halves. Core's
 * outline is transparent by design (it exists for forced-colors), so nothing
 * remained: every checkbox and every readonly support field lost its keyboard
 * focus ring entirely. WCAG 2.4.7, and the file header claims these controls
 * keep their keyboard handling.
 *
 * (0,3,1) here, so it wins outright rather than by ordering. The ring is
 * terracotta at 5.13:1 on the input ground, well past the 3:1 that WCAG 1.4.11
 * asks of a non-text indicator, and the transparent outline is kept because
 * that is what carries the indicator into Windows High Contrast.
 */
.pielyt-admin input[type="text"]:focus,
.pielyt-admin input[type="checkbox"]:focus,
.pielyt-admin input[type="submit"]:focus,
.pielyt-admin select:focus,
.pielyt-admin .button:focus,
.pielyt-admin a:focus,
.pielyt-admin summary:focus {
	border-color: var(--wpa-terracotta);
	box-shadow: 0 0 0 2px var(--wpa-terracotta);
	outline: 2px solid transparent;
	outline-offset: 0;
}

.pielyt-admin label {
	color: var(--wpa-ink-soft);
	font-weight: 600;
}

.pielyt-admin select {
	background-color: var(--wpa-paper-faint);
	border-color: var(--wpa-border);
	border-radius: 999px;
	box-shadow: none;
	color: var(--wpa-ink);
	font-family: var(--wpa-font);
}

/* ------------------------------------------------ the folded support panel */

.pielyt-admin details {
	margin: 1.4em 0;
	padding: 1.2em 1.4em;
	background: var(--wpa-paper-faint);
	border: 1px solid var(--wpa-border);
	border-radius: 16px;
}

.pielyt-admin details summary {
	color: var(--wpa-ink);
	cursor: pointer;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.pielyt-admin details summary::marker {
	color: var(--wpa-terracotta);
}

.pielyt-admin details[open] summary {
	margin-bottom: 1em;
}

/*
 * A table inside the folded panel is already on the panel's ground, so it drops
 * its own — two nested rounded boxes of nearly the same colour is the busiest a
 * quiet surface can look.
 */
.pielyt-admin details .form-table,
.pielyt-admin details .widefat {
	margin: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
}

/*
 * FIXED, NOT AUTO, ONLY HERE — 2026-09-06 (wp-5avdv). `.form-table` is `auto`
 * table-layout above, on purpose, for the switches: that lets a short label
 * column give its room to a long one instead of holding every column to the
 * same fixed share. This is a different table with a different shape problem.
 * Every row here is one label and one long readonly identifier, and `auto`
 * layout sizes a column by the CONTENT'S preferred width, not by `max-width` —
 * `input[type="text"]` above has `max-width: 100%` for exactly this table, and
 * it does nothing here, because that percentage cannot be resolved until the
 * column width is known and the column width is the thing `auto` is trying to
 * compute FROM the content. What it fell back to was core's own
 * `.regular-text` at a flat 25em, and at browser widths around 1100–1200px —
 * ordinary laptop widths, not an edge case — that pushed this table, and the
 * input inside it, visibly past the card's own right edge: found by measuring
 * it, then confirmed on a screenshot at 1100px. `fixed` layout sizes columns
 * from the explicit widths on the FIRST row instead of from any cell's
 * content — the label column keeps the `11em` set above, the value column
 * takes what is left of the card, and a long identifier scrolls inside its own
 * input rather than widening the table around it.
 */
.pielyt-admin details .form-table {
	table-layout: fixed;
}

/*
 * `margin-inline-start`, not `margin-left`: wp-admin ships an RTL stylesheet and
 * a list indented from the left in Arabic or Hebrew is indented off the wrong
 * edge. The logical property costs nothing and is correct in both directions.
 * The same reasoning does NOT extend to the notice's 4px rule below, which is
 * deliberately physical — it mirrors core's own `border-left-width`, and core
 * flips that in its own RTL sheet.
 */
.pielyt-admin details ul {
	margin: 0.4em 0 1.4em;
	margin-inline-start: 1.5em;
}

.pielyt-admin details li {
	margin: 0.25em 0;
}

/*
 * Two controls that are one choice, laid out as one. It is flex rather than
 * inline elements in a paragraph because one of the two is a `<form>`, and a
 * `<form>` implicitly closes an open `<p>` in the HTML parser — see
 * `Admin::reviewPrompt()`, which is where that cost a line break nothing asked
 * for. `align-items` keeps the pill and the text button on one baseline-ish row
 * whatever the two end up measuring.
 */
.pielyt-admin .pielyt-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1em;
	align-items: center;
	margin-top: 1em;
}

.pielyt-admin .pielyt-actions form {
	margin: 0;
}

/* ------------------------------------------------------- the period filter */

.pielyt-admin .pielyt-filter {
	margin: 0 0 1.2em;
}

.pielyt-admin .pielyt-filter label {
	margin-inline-end: 0.4em;
}

/* ---------------------------------------------- the activity outcome chips */

/*
 * Four tones, from the tokens above, and they were four hard-coded core colours
 * in an inline `<style>` block until this stylesheet reached the screen that
 * prints them. `Activity::TONES` still decides which class an entry gets; this
 * only decides what the class looks like.
 */
.pielyt-admin .pielyt-outcome {
	display: inline-block;
	padding: 0.15em 0.7em;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.7;
}

.pielyt-admin .pielyt-good {
	background: var(--wpa-good-bg);
	color: var(--wpa-good-ink);
}

.pielyt-admin .pielyt-warn {
	background: var(--wpa-warn-bg);
	color: var(--wpa-warn-ink);
}

.pielyt-admin .pielyt-danger {
	background: var(--wpa-danger-bg);
	color: var(--wpa-danger-ink);
}

.pielyt-admin .pielyt-neutral {
	background: var(--wpa-neutral-bg);
	color: var(--wpa-neutral-ink);
}

/* ----------------------------------------------------------------- notices */

/*
 * NO MORE LEFT-COLOURED RULE, 2026-09-06 (wp-5avdv). Core carries a notice's
 * status in the colour of its left border, and until today this rule went out
 * of its way to preserve that — the longhand below used to set three sides to
 * this page's own hairline and leave the fourth to whatever core's status
 * class supplied. On the live page that read as its own complaint: "the cards
 * have a colored border on the left side only, cut it." The "saved" banner and
 * the "service not reachable" warning are both a rounded, paper-coloured box
 * sitting among a suite of cards that otherwise all carry a plain hairline —
 * to an owner rather than a stylesheet, a notice with a green or gold stripe
 * down one side IS one of the cards, styled inconsistently. The sentence each
 * notice prints already says what happened ("Your changes are saved" reads
 * nothing like a warning), so the border is decoration now rather than the
 * only carrier of the status, and a plain hairline the whole page style
 * repeats plainly reads as a match rather than an omission.
 */
.pielyt-admin .notice {
	margin: 1.2em 0;
	padding: 0.9em 1.2em;
	background: var(--wpa-paper-faint);
	border: 1px solid var(--wpa-border);
	border-radius: 12px;
	box-shadow: none;
	color: var(--wpa-ink-soft);
}

.pielyt-admin .notice p {
	margin: 0;
	font-size: 14px;
}

.pielyt-admin .notice p + p {
	margin-top: 0.6em;
}

/*
 * THE REVIEW ASK LOST ITS ACCENT TOO, 2026-09-06 (wp-5avdv, second pass). This
 * rule used to give the review box's notice a terracotta left border after
 * `.pielyt-admin .notice` above stopped colouring one side of every other
 * notice on the screen -- kept on the reasoning that the review box's aesthetic
 * was wp-v2ozi's decision to make, not a side effect of an unrelated fix. That
 * reasoning did not survive a second look: wp-v2ozi's own owner instruction is
 * "remove the left sidebar blue line", and the owner's instruction on THIS bead
 * was "the cards have the colored border only on the left side, cut it", with
 * no exception for this one. Both beads point the same direction; neither
 * wants this line kept. The review box now takes the plain hairline
 * `.pielyt-admin .notice` already gives it, the same as every other notice on
 * either screen -- no rule is needed here at all.
 */

/*
 * The page-level notice — the outcome of the last action — sits above the grid
 * and is the first thing the reader is meant to see, so it gets the paper the
 * cards get rather than the fainter ground the in-card notices use.
 */
.pielyt-admin > .notice {
	margin: 0 0 2rem;
	background: var(--wpa-paper);
}

/*
 * A FAILURE HAS TO LOOK LIKE ONE, 2026-11-08 (wp-4scj4). Taking core's status
 * stripe away (wp-5avdv, above) left an error notice as the same paper box as
 * "Your changes are saved", and the owner read a refused connection as plain
 * text twice. Severity is carried by the tint and a full border in the danger
 * colour, never by one coloured side. `role="alert"` is in the markup.
 */
.pielyt-admin .notice.notice-error {
	background: var(--wpa-danger-bg);
	border-color: var(--wpa-danger-ink);
	color: var(--wpa-danger-ink);
}

.pielyt-admin .notice.notice-warning {
	background: var(--wpa-warn-bg);
	border-color: var(--wpa-warn-ink);
	color: var(--wpa-warn-ink);
}

.pielyt-admin .notice.notice-success {
	background: var(--wpa-good-bg);
	border-color: var(--wpa-good-ink);
	color: var(--wpa-good-ink);
}

/*
 * AN INFO NOTE: AN ICON, THE TEXT, A CLOSE BUTTON ON THE RIGHT, 2026-11-08.
 * The owner read the hosted-service sentence and the connected outcome as more
 * prose to skim past. The icon says what kind of line it is before it is read;
 * the close button is core's `.notice-dismiss`, positioned by core against
 * this box, so the text keeps clear of it.
 */
.pielyt-admin .notice.pielyt-note {
	position: relative;
	display: flex;
	gap: 0.7em;
	align-items: flex-start;
	padding-right: 3em;
}

.pielyt-admin .pielyt-note__icon {
	flex: none;
}

.pielyt-admin .pielyt-note__body {
	flex: 1 1 auto;
	min-width: 0;
}

.pielyt-admin .pielyt-note form {
	margin: 0;
}

/*
 * THE ONE CARD THAT ASKS THE READER TO ACT (the Finish step). Louder than every
 * other card by its tint and a full accent frame, never by one coloured side.
 */
.pielyt-admin .pielyt-card--attention {
	background: var(--wpa-warn-bg);
	border: 2px solid var(--wpa-terracotta);
}

.pielyt-admin .pielyt-card--attention h2 {
	font-size: 1.5em;
	/* The body's 1.6 leading is for paragraphs; at this size it opens a 38px
	   gap between the two lines the heading wraps to on a phone. */
	line-height: 1.25;
}

/* Core's spinner floats right by default; here it sits after the button. */
.pielyt-admin .pielyt-actions .spinner {
	float: none;
	margin: 0;
}

/*
 * THE BUSY CONNECT BUTTON STAYS LEGIBLE (wp-6rltv). Core greys a disabled
 * primary button with `!important`, which left "Opening Pielyt…" pale on pale.
 * The state keeps the primary colors and says it is working by its cursor.
 */
.pielyt-admin .button-primary[aria-busy="true"],
.pielyt-admin .button-primary[aria-busy="true"]:disabled {
	background: var(--wpa-terracotta) !important;
	border-color: var(--wpa-terracotta) !important;
	color: var(--wpa-on-terracotta) !important;
	opacity: 0.85;
	cursor: progress;
}

/* Links inside a tinted notice take the notice's ink; core's blue fails contrast on the tint. */
.pielyt-admin .notice-error a {
	color: var(--wpa-danger-ink);
}

.pielyt-admin .notice-warning a {
	color: var(--wpa-warn-ink);
}

/* The support boxes take their whole cell. */
.pielyt-admin details .form-table input[type="text"] {
	width: 100%;
}

/*
 * THE ACTIVITY TABLES STACK ON A PHONE (wp-6rltv). Four columns do not fit
 * 400px, so each row becomes a block and each cell carries its column name
 * from `data-label`, so the header row has nothing left to say and is hidden.
 */
@media screen and (max-width: 782px) {
	.pielyt-admin .pielyt-log,
	.pielyt-admin .pielyt-log tbody,
	.pielyt-admin .pielyt-log tr,
	.pielyt-admin .pielyt-log td {
		display: block;
		width: auto;
	}

	.pielyt-admin .pielyt-log thead {
		display: none;
	}

	.pielyt-admin .pielyt-log tr {
		padding: 0.6em 0;
		border-bottom: 1px solid var(--wpa-border);
	}

	.pielyt-admin .pielyt-log td {
		padding: 0.25em 12px;
		overflow-wrap: anywhere;
	}

	.pielyt-admin .pielyt-log td::before {
		content: attr(data-label);
		display: block;
		color: var(--wpa-ink-faint);
		font-size: 12px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}
}

/* The note runs the width of its box: the icon and the sentence on one line,
   not the paragraph measure above (owner, 2026-11-08). */
.pielyt-admin .pielyt-note p {
	max-width: none;
}
