/* Green theme (Material-3-style "nds-*" token system):
     --nds-a-primary        -> emerald-70 (~#14c560)
     --nds-a-primary-darker -> emerald-50 (#008a40)
     --nds-a-secondary      -> secondary-60 (#829682, muted sage)
     focus ring             -> rgba(48,191,113,0.16)
   Primary itself is pinned to the exact rgb(48 191 113) / #30bf71 requested,
   which is what render on their actual buttons.
   Must be loaded AFTER pico.min.css. */

/* Must match Pico's own light-mode selector exactly: Pico defines its
   light values on `:root:not([data-theme=dark])`, not plain `:root` — that
   compound selector has higher specificity than a bare `:root`, so a plain
   `:root { }` override here loses to Pico's own light-mode block no matter
   what order the stylesheets load in. */
:root:not([data-theme="dark"]), [data-theme="light"] {
	--pico-font-family: "UI Display", "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
	--pico-border-radius: 0.625rem;

	/* Primary: rgb(48, 191, 113) */
	--pico-primary: #30bf71;
	--pico-primary-background: #30bf71;
	--pico-primary-underline: rgba(48, 191, 113, 0.5);
	--pico-primary-hover: #008a40;
	--pico-primary-hover-background: #00a74f;
	--pico-primary-focus: rgba(48, 191, 113, 0.16);
	/* white, even though this bright a
	   green only hits ~2.4:1 contrast with white (below WCAG AA 4.5:1).
	   Their production site accepts that trade-off for brand consistency;
	   flagging in case you'd rather prioritize contrast over exact match. */
	--pico-primary-inverse: #fff;

	/* Secondary: darker, more saturated forest-green — Saladin's real
	   secondary-60 (#829682) is so desaturated it reads as plain gray
	   at button size, which isn't what we want here. */
	--pico-secondary: #3a7856;
	--pico-secondary-background: #3a7856;
	--pico-secondary-underline: rgba(58, 120, 86, 0.5);
	--pico-secondary-hover: #295642;
	--pico-secondary-hover-background: #32674a;
	--pico-secondary-focus: rgba(58, 120, 86, 0.35);
	--pico-secondary-inverse: #fff;
}

@media only screen and (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--pico-primary: #66ff92;
		--pico-primary-background: #30bf71;
		--pico-primary-underline: rgba(102, 255, 146, 0.5);
		--pico-primary-hover: #44e178;
		--pico-primary-hover-background: #14c560;
		--pico-primary-focus: rgba(102, 255, 146, 0.25);
		--pico-primary-inverse: #fff;

		--pico-secondary: #86c5a3;
		--pico-secondary-background: #3a7856;
		--pico-secondary-underline: rgba(134, 197, 163, 0.5);
		--pico-secondary-hover: #a9d6bd;
		--pico-secondary-hover-background: #64b488;
		--pico-secondary-focus: rgba(134, 197, 163, 0.3);
		--pico-secondary-inverse: #fff;
	}
}

/* Title text (page headers, nav bar title, dialog headers) — every one of
   these sits inside a <header>, which is what distinguishes it from
   incidental bold text used for data emphasis elsewhere on a page. */
header strong {
	color: var(--pico-primary);
}

[data-theme="dark"] {
	--pico-primary: #66ff92;
	--pico-primary-background: #30bf71;
	--pico-primary-underline: rgba(102, 255, 146, 0.5);
	--pico-primary-hover: #44e178;
	--pico-primary-hover-background: #14c560;
	--pico-primary-focus: rgba(102, 255, 146, 0.25);
	--pico-primary-inverse: #fff;

	--pico-secondary: #86c5a3;
	--pico-secondary-background: #3a7856;
	--pico-secondary-underline: rgba(134, 197, 163, 0.5);
	--pico-secondary-hover: #a9d6bd;
	--pico-secondary-hover-background: #64b488;
	--pico-secondary-focus: rgba(134, 197, 163, 0.3);
	--pico-secondary-inverse: #fff;
}

/* Force every button to solid green + white, regardless of Pico's own
   primary/secondary/outline styling (which would otherwise mean transparent
   backgrounds for .outline, gray/sage for .secondary, etc.). Excludes the
   dialog "Close" (x) icon buttons and the small red file-chip removal
   badges — those are icon-only, purpose-specific controls, not the
   labeled action buttons this is meant to unify. */
button:not([aria-label="Close"]):not(.file-chip-remove),
[type="button"]:not(.file-chip-remove),
[type="submit"],
[type="reset"],
[role="button"] {
	background-color: var(--pico-primary-background) !important;
	border-color: var(--pico-primary-background) !important;
	color: #fff !important;
}

button:not([aria-label="Close"]):not(.file-chip-remove):is(:hover, :focus, :active),
[type="button"]:not(.file-chip-remove):is(:hover, :focus, :active),
[type="submit"]:is(:hover, :focus, :active),
[type="reset"]:is(:hover, :focus, :active),
[role="button"]:is(:hover, :focus, :active) {
	background-color: var(--pico-primary-hover-background) !important;
	border-color: var(--pico-primary-hover-background) !important;
	color: #fff !important;
}
