/*
  Lean Core admin design tokens — the shared palette for first-party plugin
  admin surfaces.

  Registered as `lean-core-tokens` and declared as a dependency of
  `lean-core-admin`, so every plugin that already depends on the Lean Core
  admin stylesheet inherits these without extra wiring.

  Accent roles follow the active WordPress admin color scheme through core's
  own custom properties (`--wp-admin-theme-color*`) with a literal fallback,
  so first-party screens track palettes such as "Ectoplasm" instead of
  pinning the default blue.

  Plugin-local token files (Lean SEO, Lean Legal) alias these rather than
  repeating literals. Where a plugin deliberately uses a different value, it
  keeps its own literal and documents why — this file is the default, not a
  mandate.
*/

:root {
	/* Accent (follows the admin color scheme) */
	--lean-accent: var( --wp-admin-theme-color, #2271b1 );
	--lean-accent-hover: var( --wp-admin-theme-color-darker-10, #135e96 );
	--lean-accent-subtle: #f0f6fc;
	/* Foreground for text and icons sitting on an accent fill. */
	--lean-on-accent: #fff;

	/* Text */
	--lean-text: #1d2327;
	--lean-muted: #50575e;

	/* Surfaces and borders */
	--lean-surface: #fff;
	--lean-surface-muted: #f6f7f7;
	--lean-surface-alt: #f0f0f1;
	--lean-border: #c3c4c7;
	--lean-border-strong: #8c8f94;
	--lean-border-subtle: #dcdcde;

	/* Text (secondary roles) */
	--lean-text-strong: #2c3338;
	--lean-muted-strong: #646970;

	/* Status */
	--lean-danger: #d63638;
	/*
	  Destructive text and links on a light surface. Deliberately darker
	  than --lean-danger, which fails AA at small sizes; WordPress core
	  draws the same distinction.
	*/
	--lean-danger-text: #b32d2e;
	--lean-success: #008a20;
	--lean-warning: #ffb900;
	/*
	  Cautionary text on a light surface. --lean-warning is a fill colour
	  (notice stripes, status dots) and is unreadable as small text; this is
	  the darkened amber that stays legible, mirroring the same split we
	  already make between --lean-danger and --lean-danger-text.
	*/
	--lean-warning-text: #b26200;

	/*
	  Status surface washes. The solid roles above are foregrounds — a fill
	  for a dot, a stripe or small text. A status *background* needs a pale
	  tint that dark body text still reads on, which is a different colour,
	  not an opacity of the same one. Lean Legal built this scale for its
	  status pills and callouts and Lean SEO independently needed the green
	  for its row-save flash, so it belongs here rather than in either.
	*/
	--lean-success-subtle: #d4edda;
	--lean-warning-subtle: #fff3cd;
	--lean-danger-subtle: #f8d7da;
	--lean-info-subtle: #d1ecf1;

	/*
	  Focus ring. Custom controls that suppress the native `outline` must
	  repaint focus with this, so the ring tracks the admin color scheme
	  instead of pinning a literal blue.
	*/
	--lean-focus-ring: 0 0 0 2px color-mix( in srgb, var( --lean-accent ) 25%, transparent );

	/*
	  Corner radius. Values mirror the Elementor Framework frontend scale
	  (`--ef-radius-*`) so admin and frontend surfaces round identically.
	  They are restated rather than aliased because the EF tokens are emitted
	  on the frontend only, and EF depends on Lean Core — not the reverse.
	*/
	--lean-radius-s: 4px;
	--lean-radius-m: 8px;
	--lean-radius-l: 12px;
	--lean-radius-pill: 999px;

	/*
	  Type scale. These are the four sizes wp-admin itself uses: 13px is the
	  admin body size set on `body` in wp-admin/css/common.css, and 14px is
	  the control size set on inputs in forms.css. We restate them so our
	  surfaces sit on the same scale as core rather than drifting per plugin.

	  Roles, by how they are already used across our admin stylesheets:
	    micro — badges, pills, status chips, post IDs
	    small — inline controls, inline code, compact form fields
	    base  — the admin default: tables, menus, messages
	    prose — body copy and section intros
	*/
	--lean-font-micro: 11px;
	--lean-font-small: 12px;
	--lean-font-base: 13px;
	--lean-font-prose: 14px;
	--lean-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

	/*
	  Semantic admin elevation. Keep focus rings, inset validation outlines,
	  coloured action glows, and frontend/editor shadows outside this scale.
	*/
	--lean-elevation-card: 0 1px 1px rgb(0 0 0 / 4%);
	--lean-elevation-popover: 0 4px 12px rgb(0 0 0 / 12%);
	--lean-elevation-modal: 0 5px 25px rgb(0 0 0 / 30%);

	/*
	  Overlay stacking order. wp-admin computes #wpadminbar at 99999 and
	  #adminmenuwrap at 9990, so anything that must cover the admin chrome
	  has to clear 99999. Our surfaces previously did that by ad-hoc bumps
	  (100000, 100001, 100050, 999999) with no recorded intent, which is how
	  an overlay ends up one step above the admin bar by luck.

	  These three steps preserve the order those bumps had arrived at, with
	  gaps so a new layer can slot between them without another escalation:
	    overlay — modal backdrops and dropdown surfaces
	    modal   — the modal panel itself, above its own backdrop
	    toast   — transient notices, above everything we render
	*/
	--lean-z-overlay: 100000;
	--lean-z-modal: 100100;
	--lean-z-toast: 100200;

	/*
	  Readable measure. Long-form admin copy — section intros, `.description`
	  paragraphs, settings forms — is capped so a line stays scannable on a
	  wide screen instead of running the full width of the content column.

	  640px is the width our admin surfaces had each arrived at independently
	  (Lean Core's SMTP page, Voxel Addon's translation page), restated here
	  so the measure is set in one place. It is a text measure, not a box
	  width: the modal is also 640px wide, and deliberately does not read
	  this token, because a dialog's width and a paragraph's measure are
	  free to diverge.
	*/
	--lean-measure-prose: 640px;
}
