/* ==========================================================================
   AI Law Wiki — "Docket Terminal" theme for Vector 2022
   --------------------------------------------------------------------------
   Pure CSS. No page, template or wikitext changes required.
   Deploy as a static file; see README.md. Load order relative to
   Vector, Common.css and ailaw-theme.css does not matter (tested both ways).

   Works with the existing appearance controls:
     html.skin-theme-clientpref-night  -> dark terminal
     html.skin-theme-clientpref-day    -> light "paper" terminal
     html.skin-theme-clientpref-os     -> follows the OS
   Inline colours in page markup are already routed through the --ailaw-*
   tokens by ailaw-theme.css; this file re-points those tokens and restyles
   the known blocks (.ailaw-*, #ailaw-*, Cite, catlinks, Vector chrome).
   ========================================================================== */

/* IBM Plex Sans + Mono, self-hosted (SIL Open Font License 1.1, see fonts/OFL-IBM-Plex.txt).
   URLs are relative to this CSS file: keep css/ and fonts/ side by side. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.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 Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.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 Sans';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-sans-latin-ext-400-italic.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 Sans';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-sans-latin-400-italic.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 Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../fonts/ibm-plex-sans-latin-ext-500-normal.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 Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.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 Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.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 Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.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 Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/ibm-plex-sans-latin-ext-700-normal.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 Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/ibm-plex-sans-latin-700-normal.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-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-mono-latin-ext-400-normal.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-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.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-display: swap;
  font-weight: 500;
  src: url("../fonts/ibm-plex-mono-latin-ext-500-normal.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-display: swap;
  font-weight: 500;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.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-display: swap;
  font-weight: 600;
  src: url("../fonts/ibm-plex-mono-latin-ext-600-normal.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-display: swap;
  font-weight: 600;
  src: url("../fonts/ibm-plex-mono-latin-600-normal.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;
}

/* --------------------------------------------------------------------------
   1. Palettes
   -------------------------------------------------------------------------- */

/* Light ("paper") — day, and OS when the OS is light */
html.skin-theme-clientpref-day:root,
html.skin-theme-clientpref-os:root {
	--dt-bg: #f3f4f1;
	--dt-surface: #eaece8;
	--dt-raised: #ffffff;
	--dt-line: #cfd4d8;
	--dt-line-soft: #dfe3e5;
	--dt-line-strong: #9aa3ac;
	--dt-text: #0a0c0f;
	--dt-text-2: #2a3138;
	--dt-muted: #535d67;
	--dt-accent: #a85a00;        /* text-safe amber */
	--dt-accent-fill: #ffb224;   /* amber fill, dark text on top */
	--dt-on-accent: #0a0c0f;
	--dt-info: #00648f;
	--dt-link: #0b57a8;
	--dt-link-visited: #6a3fb0;
	--dt-link-red: #b3261e;
	--dt-focus: #0b57a8;
	color-scheme: light;
}

/* Dark ("terminal") — night */
html.skin-theme-clientpref-night:root {
	--dt-bg: #0a0c0f;
	--dt-surface: #0e1115;
	--dt-raised: #11151a;
	--dt-line: #232a33;
	--dt-line-soft: #1a2028;
	--dt-line-strong: #3a4450;
	--dt-text: #e6e8eb;
	--dt-text-2: #c5cbd3;
	--dt-muted: #a2acb7;
	--dt-accent: #ffb224;
	--dt-accent-fill: #ffb224;
	--dt-on-accent: #0a0c0f;
	--dt-info: #5cc8ff;
	--dt-link: #8ccbff;
	--dt-link-visited: #c3b2ff;
	--dt-link-red: #ff8a7a;
	--dt-focus: #ffb224;
	color-scheme: dark;
}
@media screen and (prefers-color-scheme: dark) {
	html.skin-theme-clientpref-os:root {
		--dt-bg: #0a0c0f;
		--dt-surface: #0e1115;
		--dt-raised: #11151a;
		--dt-line: #232a33;
		--dt-line-soft: #1a2028;
		--dt-line-strong: #3a4450;
		--dt-text: #e6e8eb;
		--dt-text-2: #c5cbd3;
		--dt-muted: #a2acb7;
		--dt-accent: #ffb224;
		--dt-accent-fill: #ffb224;
		--dt-on-accent: #0a0c0f;
		--dt-info: #5cc8ff;
		--dt-link: #8ccbff;
		--dt-link-visited: #c3b2ff;
		--dt-link-red: #ff8a7a;
		--dt-focus: #ffb224;
		color-scheme: dark;
	}
}

/* Shared tokens, and Vector/Codex + legacy --ailaw-* tokens re-pointed */
html:root[class] {
	--dt-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--dt-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

	--background-color-base: var(--dt-bg);
	--background-color-neutral-subtle: var(--dt-surface);
	--background-color-neutral: var(--dt-raised);
	--background-color-interactive-subtle: var(--dt-surface);
	--background-color-interactive: var(--dt-raised);
	--background-color-interactive--hover: var(--dt-line-soft);
	--background-color-button-quiet--hover: var(--dt-line-soft);
	--background-color-progressive: var(--dt-accent-fill);
	--background-color-progressive--hover: var(--dt-accent-fill);
	--background-color-input-binary--checked: var(--dt-accent-fill);
	--color-base: var(--dt-text);
	--color-emphasized: var(--dt-text);
	--color-subtle: var(--dt-muted);
	--color-placeholder: var(--dt-muted);
	--color-progressive: var(--dt-link);
	--color-progressive--hover: var(--dt-accent);
	--color-link: var(--dt-link);
	--color-link--hover: var(--dt-accent);
	--color-link--visited: var(--dt-link-visited);
	--color-visited: var(--dt-link-visited);
	--color-link-red: var(--dt-link-red);
	--color-link-red--visited: var(--dt-link-red);
	--border-color-base: var(--dt-line-strong);
	--border-color-subtle: var(--dt-line);
	--border-color-muted: var(--dt-line);
	--border-color-divider: var(--dt-line);
	--border-color-interactive: var(--dt-line-strong);
	--border-color-progressive: var(--dt-accent);
	--border-color-input-binary--checked: var(--dt-accent-fill);
	--outline-color-progressive--focus: var(--dt-focus);
	--box-shadow-color-progressive--focus: var(--dt-focus);

	--ailaw-blue-surface: var(--dt-surface);
	--ailaw-blue-card: var(--dt-surface);
	--ailaw-about-surface: var(--dt-surface);
	--ailaw-purple-surface: var(--dt-surface);
	--ailaw-green-card: var(--dt-surface);
	--ailaw-green-surface: var(--dt-surface);
	--ailaw-amber-surface: var(--dt-surface);
	--ailaw-info-surface: var(--dt-surface);
	--ailaw-disclosure-surface: transparent;
	--ailaw-text: var(--dt-text);
	--ailaw-disclosure-text: var(--dt-text-2);
	--ailaw-muted: var(--dt-muted);
	--ailaw-gray: var(--dt-muted);
	--ailaw-label: var(--dt-muted);
	--ailaw-blue-heading: var(--dt-text);
	--ailaw-purple-heading: var(--dt-text);
	--ailaw-green-heading: var(--dt-text);
	--ailaw-amber-heading: var(--dt-text);
	--ailaw-border: var(--dt-line);
	--ailaw-row-border: var(--dt-line);
	--ailaw-info-border: var(--dt-line);
	--ailaw-blue-border: var(--dt-line);
	--ailaw-purple-border: var(--dt-line);
	--ailaw-green-border: var(--dt-line);
	--ailaw-amber-border: var(--dt-line);
	--ailaw-disclosure-border: var(--dt-info);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
html, body { background: var(--dt-bg); color: var(--dt-text); }
body, .mw-body, .vector-header, .mw-footer, .vector-menu, .vector-pinnable-element {
	font-family: var(--dt-sans);
}
::selection { background: var(--dt-accent-fill); color: var(--dt-on-accent); }
:focus-visible { outline: 2px solid var(--dt-focus); outline-offset: 2px; }

.mw-page-container { background: var(--dt-bg); }

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.vector-header-container {
	border-bottom: 1px solid var(--dt-line);
	background: var(--dt-bg);
}
.vector-sticky-header { background: var(--dt-bg); border-bottom: 1px solid var(--dt-line); box-shadow: none; }

/* Citation branding: use supplied artwork, without color inversion. */
.mw-logo-container.skin-invert { filter: none !important; }
.mw-logo-wordmark { content: url("/resources/assets/brand-v2/ailawwiki-logo-light.svg"); }
html.skin-theme-clientpref-night .mw-logo-wordmark { content: url("/resources/assets/brand-v2/ailawwiki-logo-dark.svg"); }
@media screen and (prefers-color-scheme: dark) {
	html.skin-theme-clientpref-os .mw-logo-wordmark { content: url("/resources/assets/brand-v2/ailawwiki-logo-dark.svg"); }
}

/* Search as a command line */
.vector-search-box .cdx-text-input__input,
.vector-search-box .cdx-search-input__input-wrapper .cdx-text-input__input {
	background: var(--dt-surface);
	border: 1px solid var(--dt-line-strong);
	border-radius: 0;
	color: var(--dt-text);
	font-family: var(--dt-mono);
	font-size: 0.875rem;
	box-shadow: none;
}
.vector-search-box .cdx-text-input__input:focus {
	border-color: var(--dt-accent);
	box-shadow: inset 0 0 0 1px var(--dt-accent);
}
.vector-search-box .cdx-search-input__end-button {
	border-radius: 0;
	background: var(--dt-accent-fill);
	border-color: var(--dt-accent-fill);
	color: var(--dt-on-accent);
	font-family: var(--dt-mono);
	font-weight: 600;
	text-transform: lowercase;
}
.vector-search-box .cdx-search-input__end-button:hover { filter: brightness(1.08); }

/* User links and buttons */
.vector-user-links, .vector-user-links a,
.vector-pinnable-header-label, .vector-pinnable-header-toggle-button,
.vector-menu-heading, .vector-dropdown-label-text {
	font-family: var(--dt-mono);
}
.vector-user-links a { font-size: 0.8125rem; text-transform: lowercase; }

/* Existing day / night / auto control (#ailaw-appearance-bar) */
#ailaw-appearance-bar .ailaw-appearance-controls { border-radius: 0; background: var(--dt-surface); border-color: var(--dt-line-strong); }
#ailaw-appearance-bar button { border-radius: 0; color: var(--dt-muted); }
#ailaw-appearance-bar button[aria-pressed="true"] { background: var(--dt-accent-fill); color: var(--dt-on-accent); }

/* Dropdowns and pinned panels */
.vector-dropdown-content { background: var(--dt-raised); border: 1px solid var(--dt-line-strong); border-radius: 0; box-shadow: 0 12px 32px rgb(0 0 0 / 0.35); }
.vector-pinnable-header-label {
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-muted);
}
.vector-pinnable-header { border-bottom-color: var(--dt-line); }
.vector-pinnable-header-toggle-button {
	border-radius: 0;
	background: transparent;
	border: 1px solid var(--dt-line);
	color: var(--dt-muted);
	font-size: 0.6875rem;
}
.vector-menu-heading { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dt-muted); }
.vector-appearance .cdx-label__label__text, .vector-appearance .vector-menu-heading { font-family: var(--dt-mono); }

/* --------------------------------------------------------------------------
   4. Contents rail (Vector TOC) — numbered 01, 02, …
   -------------------------------------------------------------------------- */
.vector-toc { font-family: var(--dt-mono); font-size: 0.8125rem; counter-reset: dt-toc; }
.vector-toc .vector-toc-list-item { padding-left: 0; }
.vector-toc .vector-toc-level-1 > .vector-toc-link {
	display: block;
	padding: 0.45em 0 0.45em 0.85em;
	border-left: 2px solid var(--dt-line);
	color: var(--dt-muted);
}
.vector-toc .vector-toc-level-1:has(.vector-toc-numb) { counter-increment: dt-toc; }
.vector-toc .vector-toc-level-1:has(.vector-toc-numb) > .vector-toc-link .vector-toc-text::before {
	content: counter(dt-toc, decimal-leading-zero);
	color: var(--dt-accent);
	margin-right: 0.75em;
}
.vector-toc .vector-toc-numb { display: none; }
.vector-toc .vector-toc-text { display: flex; gap: 0; text-transform: lowercase; }
.vector-toc .vector-toc-level-1:has(.vector-toc-numb) > .vector-toc-link .vector-toc-text::before { flex: none; }
.vector-toc .vector-toc-list-item-active > .vector-toc-link,
.vector-toc .vector-toc-level-1-active > .vector-toc-link {
	border-left-color: var(--dt-accent);
	color: var(--dt-text);
	font-weight: 500;
}
.vector-toc .vector-toc-link:hover { color: var(--dt-text); text-decoration: none; }
.vector-toc .vector-toc-level-2 .vector-toc-link { padding-left: 2.6em; color: var(--dt-muted); }

/* --------------------------------------------------------------------------
   5. Page title
   -------------------------------------------------------------------------- */
.vector-page-titlebar { box-shadow: none; border-bottom: 1px solid var(--dt-line); padding-bottom: 0.5rem; }
.mw-first-heading,
.mw-body h1.firstHeading {
	font-family: var(--dt-sans);
	font-weight: 600;
	font-size: clamp(2rem, 3.6vw, 3.25rem);
	line-height: 1.05;
	letter-spacing: -0.025em;
	color: var(--dt-text);
	border: 0;
	padding-top: 1.5rem;
}
/* Kind tag above the title, inferred from the page's own layout block */
.vector-body-before-content { font-family: var(--dt-mono); }
.mw-page-container:has(.ailaw-case-layout) .mw-first-heading::before,
.mw-page-container:has(.ailaw-legislation-layout) .mw-first-heading::before,
.mw-page-container:has(.ailaw-news-region, .ailaw-digest-story) .mw-first-heading::before,
body.ns-14 .mw-first-heading::before {
	display: block;
	width: fit-content;
	margin-bottom: 0.9rem;
	padding: 0.2rem 0.45rem;
	font-family: var(--dt-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-accent);
	border: 1px solid var(--dt-accent);
}
.mw-page-container:has(.ailaw-case-layout) .mw-first-heading::before { content: "Case"; }
.mw-page-container:has(.ailaw-legislation-layout) .mw-first-heading::before { content: "Law & policy"; }
.mw-page-container:has(.ailaw-news-region, .ailaw-digest-story) .mw-first-heading::before { content: "Digest"; }
body.ns-14 .mw-first-heading::before { content: "Category"; }
.mw-first-heading .mw-page-title-namespace { color: var(--dt-muted); }

/* Edit toolbar (signed-in editors only) */
.vector-page-toolbar, .vector-page-toolbar .vector-menu-tabs a { font-family: var(--dt-mono); text-transform: lowercase; }
.vector-menu-tabs .mw-list-item.selected a { border-bottom: 2px solid var(--dt-accent); color: var(--dt-text); }

/* AI-generated text notice: keep it, make it a status line */
#ailawwiki-ai-disclosure {
	border: 1px dashed var(--dt-info) !important;
	border-left-width: 1px !important;
	background: transparent !important;
	color: var(--dt-text-2) !important;
	font-family: var(--dt-mono);
	font-size: 0.75rem !important;
	padding: 4px 10px !important;
	margin: 0.25rem 0 1.5rem !important;
}
#ailawwiki-ai-disclosure strong { color: var(--dt-info); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 0.4em; }

/* --------------------------------------------------------------------------
   6. Article typography
   -------------------------------------------------------------------------- */
.mw-body-content, .mw-parser-output { color: var(--dt-text-2); }
.mw-parser-output { counter-reset: dt-h2 dt-sec; }
.mw-parser-output p, .mw-parser-output li, .mw-parser-output dd { line-height: 1.65; }
.mw-parser-output > p:first-of-type,
.ailaw-case-article > p:first-of-type,
.ailaw-legislation-article > p:first-of-type {
	font-size: 1.2em;
	line-height: 1.5;
	color: var(--dt-text);
}
.mw-parser-output b, .mw-parser-output strong { color: var(--dt-text); font-weight: 600; }

/* Section headings: "01  Claims and issues" */
.mw-parser-output .mw-heading2 { counter-increment: dt-h2; border: 0; margin-top: 1.9em; padding: 0; }
.mw-parser-output .mw-heading2 h2,
.mw-parser-output .mw-heading2 {
	font-family: var(--dt-sans);
	font-weight: 600;
	font-size: 1.45em;
	letter-spacing: -0.015em;
	color: var(--dt-text);
	border-bottom: 0;
}
.mw-parser-output .mw-heading2 h2::before {
	content: counter(dt-h2, decimal-leading-zero);
	font-family: var(--dt-mono);
	font-size: 0.5em;
	font-weight: 500;
	letter-spacing: 0;
	color: var(--dt-accent);
	margin-right: 0.9em;
	vertical-align: 0.35em;
}
.mw-parser-output .mw-heading3, .mw-parser-output .mw-heading3 h3 {
	font-family: var(--dt-sans);
	font-weight: 600;
	font-size: 1.2em;
	color: var(--dt-text);
}
.mw-parser-output .mw-heading4 h4 {
	font-family: var(--dt-mono);
	font-size: 0.85em;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--dt-muted);
}

/* Links */
.mw-parser-output a { text-decoration: none; }
.mw-parser-output a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mw-parser-output a.external { background-image: none; padding-right: 0; }
.mw-parser-output a.external:not(.text)::after,
.mw-parser-output .reference-text a.external::after {
	content: "\2197";
	font-family: var(--dt-mono);
	font-size: 0.8em;
	margin-left: 0.2em;
	color: var(--dt-muted);
}

/* Lists */
.mw-parser-output ul { list-style: none; margin-left: 0; }
.mw-parser-output ul > li { position: relative; padding-left: 1.2em; }
.mw-parser-output ul > li::before {
	content: "\203A";
	position: absolute;
	left: 0.1em;
	color: var(--dt-accent);
	font-family: var(--dt-mono);
}
/* "See also" / related lists read as an index */
.mw-parser-output .mw-heading2 + ul > li {
	padding: 0.55em 0 0.55em 1.2em;
	border-top: 1px solid var(--dt-line-soft);
	margin: 0;
}
.mw-parser-output .mw-heading2 + ul > li:last-child { border-bottom: 1px solid var(--dt-line-soft); }
.mw-parser-output .mw-heading2 + ul > li::before { top: 0.55em; }

/* Inline citations */
.mw-parser-output sup.reference { font-family: var(--dt-mono); font-size: 0.7em; }
.mw-parser-output sup.reference a { color: var(--dt-accent); }
.mw-parser-output sup.reference .cite-bracket { color: var(--dt-muted); }

/* Code */
.mw-parser-output code, .mw-parser-output pre {
	font-family: var(--dt-mono);
	background: var(--dt-surface);
	border: 1px solid var(--dt-line);
	border-radius: 0;
	color: var(--dt-text);
}

/* Generic tables */
.mw-parser-output table.wikitable {
	background: var(--dt-surface);
	color: var(--dt-text-2);
	border: 1px solid var(--dt-line);
	border-collapse: collapse;
}
.mw-parser-output table.wikitable > * > tr > th,
.mw-parser-output table.wikitable > * > tr > td {
	border: 0;
	border-bottom: 1px solid var(--dt-line-soft);
	padding: 0.6em 0.85em;
	background: transparent;
}
.mw-parser-output table.wikitable > * > tr > th {
	font-family: var(--dt-mono);
	font-size: 0.75em;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--dt-muted);
	text-align: left;
}
.mw-parser-output table.wikitable > caption {
	font-family: var(--dt-mono);
	font-size: 0.75em !important;
	font-weight: 500 !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-muted);
	text-align: left;
	padding: 0.7em 0.85em !important;
	background: var(--dt-surface);
	border: 1px solid var(--dt-line);
	border-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. Case pages (.ailaw-case-layout / .ailaw-case-info)
   -------------------------------------------------------------------------- */
.ailaw-case-layout { gap: 2.5em !important; }
.ailaw-case-sidebar { position: sticky; top: 4.5rem; }
table.ailaw-case-info > tbody > tr { display: grid; grid-template-columns: 1fr; }
table.ailaw-case-info > tbody > tr > th { width: auto !important; padding-bottom: 0.1em !important; border-bottom: 0 !important; }
table.ailaw-case-info > tbody > tr > td { padding-top: 0.15em !important; color: var(--dt-text); }
/* Status is the template's last row: lift it */
table.ailaw-case-info > tbody > tr:last-child { background: var(--dt-raised); box-shadow: inset 2px 0 0 var(--dt-accent-fill); }
table.ailaw-case-info > tbody > tr:last-child > th { color: var(--dt-accent); }
/* Docket number reads as data */
table.ailaw-case-info > tbody > tr:nth-child(3) > td { font-family: var(--dt-mono); font-size: 0.95em; }

/* --------------------------------------------------------------------------
   8. Law & policy pages (.ailaw-legislation-layout)
   -------------------------------------------------------------------------- */
.ailaw-legislation-layout { gap: 2.5em !important; }
/* Same side as case pages: facts on the right */
.ailaw-legislation-information {
	order: 2;
	flex: 0 1 22em !important;
	position: sticky;
	top: 4.5rem;
	padding: 0 !important;
	border: 1px solid var(--dt-line) !important;
	border-radius: 0 !important;
	background: var(--dt-surface) !important;
}
.ailaw-legislation-article { order: 1; }
.ailaw-legislation-information > div {
	padding: 0.6em 0.85em !important;
	border-bottom: 1px solid var(--dt-line-soft) !important;
	color: var(--dt-text);
	line-height: 1.5;
}
.ailaw-legislation-information > div:last-child { border-bottom: 0 !important; }
.ailaw-legislation-information > div > strong {
	display: block;
	font-family: var(--dt-mono);
	font-size: 0.75em;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--dt-muted);
}
.ailaw-legislation-information > div > strong + br { display: none; }
.ailaw-legislation-information > div:first-child {
	font-size: 1em !important;
	padding: 0.7em 0.85em !important;
	border-bottom: 1px solid var(--dt-line) !important;
}
.ailaw-legislation-information > div:first-child > strong { letter-spacing: 0.08em; }

/* --------------------------------------------------------------------------
   9. References and categories
   -------------------------------------------------------------------------- */
.mw-parser-output .mw-references-wrap,
.mw-parser-output ol.references { font-family: var(--dt-mono); font-size: 0.8125rem; }
.mw-parser-output ol.references { list-style: none; margin-left: 0; counter-reset: dt-ref; }
.mw-parser-output ol.references > li {
	counter-increment: dt-ref;
	position: relative;
	padding: 0.35em 0 0.35em 3.2em;
	line-height: 1.55;
	color: var(--dt-text-2);
}
.mw-parser-output ol.references > li::before {
	content: "[" counter(dt-ref) "]";
	position: absolute;
	left: 0;
	color: var(--dt-accent);
}
.mw-parser-output .mw-cite-backlink { color: var(--dt-muted); font-size: 0.85em; }
.mw-parser-output .mw-cite-backlink a { color: var(--dt-muted); }
.mw-parser-output ol.references li:target { background: var(--dt-raised); }

.catlinks {
	background: transparent;
	border: 0;
	border-top: 1px solid var(--dt-line);
	border-radius: 0;
	padding: 1.25em 0 0;
	margin-top: 2.5em;
	font-family: var(--dt-mono);
	font-size: 0.8125rem;
}
.catlinks .mw-normal-catlinks { font-size: 0; }
.catlinks .mw-normal-catlinks ul { font-size: 0.8125rem; }
.catlinks { margin-bottom: 2.5em; }
.catlinks .mw-normal-catlinks > a:first-child {
	display: block;
	margin-bottom: 0.6em;
	color: var(--dt-muted);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.75rem;
}
.catlinks .mw-normal-catlinks > a:first-child::after { content: " / filed under"; text-transform: uppercase; }
.catlinks ul { display: flex !important; flex-wrap: wrap; gap: 0.5em; }
.catlinks li { border: 0 !important; padding: 0 !important; margin: 0 !important; }
.catlinks li::before, .catlinks li::after { content: none !important; }
.catlinks li a {
	display: inline-block;
	padding: 0.55em 0.8em;
	border: 1px solid var(--dt-line-strong);
	color: var(--dt-text-2);
	text-transform: lowercase;
}
.catlinks li a:hover { border-color: var(--dt-accent); color: var(--dt-accent); text-decoration: none; }
.catlinks li a.new { color: var(--dt-link-red); border-style: dashed; }

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.mw-footer-container { border-top: 1px solid var(--dt-line); background: var(--dt-bg); }
.mw-footer { border-top: 0; font-family: var(--dt-mono); font-size: 0.8125rem; color: var(--dt-muted); }
.mw-footer li { color: var(--dt-muted); }
.mw-footer a { color: var(--dt-text-2); text-transform: lowercase; }

/* --------------------------------------------------------------------------
   11. Main Page
   -------------------------------------------------------------------------- */
/* More room for the front page */
body.page-Main_Page .vector-page-titlebar,
body.page-Main_Page .vector-page-toolbar,
body.page-Main_Page #mw-content-text { max-width: 80rem; }
body.page-Main_Page #mw-content-text .mw-parser-output > div[style*="max-width: 72em"] { max-width: none !important; }
body.page-Main_Page .vector-page-titlebar { border-bottom: 0; }

/* Edition: lead + regions on the left, the week ahead on the right */
#Daily_Digests.ailaw-digest-edition {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
	column-gap: 2.5rem;
	align-items: start;
}
#Daily_Digests > * { grid-column: 1; }
#Daily_Digests > #ailaw-weekly-lookahead {
	grid-column: 2;
	grid-row: 1 / span 12;
	position: sticky;
	top: 4.5rem;
}
#Daily_Digests > div:first-child {
	font-family: var(--dt-mono);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--dt-muted);
	padding: 1.1em 0 0.2em;
}
#Daily_Digests > div:first-child .ailaw-last-updated::before { content: "\25CF  "; color: var(--dt-accent); }

/* Lead story */
body #mw-content-text #Daily_Digests .ailaw-lead-story {
	background: transparent !important;
	border-top: 0 !important;
	padding: 1.2em 0 2em !important;
	border-bottom: 1px solid var(--dt-line);
}
body #mw-content-text #Daily_Digests .ailaw-lead-story h2 {
	font-family: var(--dt-sans) !important;
	font-weight: 600 !important;
	font-size: clamp(2.2rem, 4.4vw, 4rem) !important;
	line-height: 1.02 !important;
	letter-spacing: -0.03em;
	color: var(--dt-text) !important;
	margin-bottom: 0.45em !important;
}
.ailaw-lead-story h2::before {
	content: "Lead";
	display: block;
	width: fit-content;
	margin-bottom: 1.1rem;
	padding: 0.2rem 0.45rem;
	font-family: var(--dt-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-accent);
	border: 1px solid var(--dt-accent);
}
body #mw-content-text #Daily_Digests .ailaw-lead-story > p { font-size: 1.2em !important; line-height: 1.5 !important; color: var(--dt-text-2); max-width: 46em; }

/* Source lines under every story */
.ailaw-story-links { font-family: var(--dt-mono); font-size: 0.75rem !important; color: var(--dt-muted); }
.ailaw-story-links a { color: var(--dt-text-2); }
.ailaw-story-links a[href*="Digest"], .ailaw-story-links a[title^="AI Law Wiki News"] { color: var(--dt-accent); }
.ailaw-lead-story .ailaw-story-links { margin-top: 1.1em !important; font-size: 0.8125rem !important; }

/* Region jump links */
.ailaw-region-jumps {
	font-family: var(--dt-mono);
	font-size: 0.75rem !important;
	text-transform: lowercase;
	border-bottom: 0 !important;
	gap: 0.5em !important;
}
.ailaw-region-jumps a { padding: 0.55em 0.8em; border: 1px solid var(--dt-line-strong); color: var(--dt-text-2); }
.ailaw-region-jumps a:hover { border-color: var(--dt-accent); color: var(--dt-accent); text-decoration: none; }

/* Region feeds */
body #mw-content-text .ailaw-region-heading {
	font-family: var(--dt-mono) !important;
	font-size: 0.75rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.08em !important;
	color: var(--dt-muted) !important;
	border-bottom: 1px solid var(--dt-line) !important;
	padding-bottom: 0.7em !important;
}
.ailaw-region-heading::before { content: "/ "; color: var(--dt-accent); }
.ailaw-digest-story { border-bottom-color: var(--dt-line-soft) !important; padding: 1em 0 !important; }
body #mw-content-text .ailaw-digest-story h3 {
	font-family: var(--dt-sans) !important;
	font-weight: 500 !important;
	font-size: 1.15em !important;
	line-height: 1.3 !important;
	color: var(--dt-text) !important;
}
.ailaw-digest-story > p { color: var(--dt-text-2); font-size: 0.875em !important; }

/* Week ahead (existing calendar markup, restacked as a list) */
body #mw-content-text #ailaw-weekly-lookahead {
	background: var(--dt-surface) !important;
	border: 1px solid var(--dt-line);
	padding: 0 !important;
	margin-top: 1.2em !important;
}
#ailaw-weekly-lookahead .ailaw-calendar-header {
	margin: 0;
	padding: 0.75em 1em;
	border-bottom: 1px solid var(--dt-line);
	font-family: var(--dt-mono);
}
body #mw-content-text #ailaw-weekly-lookahead .ailaw-calendar-header h3 {
	font-family: var(--dt-mono) !important;
	font-size: 0.75rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-muted) !important;
}
#ailaw-weekly-lookahead .ailaw-calendar-week { font-size: 0.75rem; color: var(--dt-muted); }
#ailaw-weekly-lookahead .ailaw-calendar-grid { display: block; border: 0; }
#ailaw-weekly-lookahead .ailaw-calendar-day {
	display: grid;
	grid-template-columns: 4.1rem minmax(0, 1fr);
	column-gap: 0.75rem;
	padding: 0.8em 1em;
	border-right: 0;
	border-bottom: 1px solid var(--dt-line-soft);
	background: transparent;
	box-shadow: none;
}
#ailaw-weekly-lookahead .ailaw-calendar-day:last-child { border-bottom: 0; }
#ailaw-weekly-lookahead .ailaw-calendar-dayname,
#ailaw-weekly-lookahead .ailaw-calendar-date { grid-column: 1; font-family: var(--dt-mono); }
#ailaw-weekly-lookahead .ailaw-calendar-dayname { grid-row: 1; font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--dt-muted); }
#ailaw-weekly-lookahead .ailaw-calendar-date { grid-row: 2 / span 6; align-self: start; font-size: 1.6em; line-height: 1.1; margin: 0; color: var(--dt-text); }
#ailaw-weekly-lookahead .ailaw-calendar-event { grid-column: 2; font-size: 0.8125em; line-height: 1.45; margin: 0 0 0.75em; color: var(--dt-text-2); }
#ailaw-weekly-lookahead .ailaw-calendar-dayname + .ailaw-calendar-date + .ailaw-calendar-event { grid-row: 1 / span 2; }
#ailaw-weekly-lookahead .ailaw-calendar-event strong { color: var(--dt-text); font-weight: 500; }
#ailaw-weekly-lookahead .ailaw-calendar-event .ailaw-story-links { font-size: 0.6875rem !important; }
#ailaw-weekly-lookahead .ailaw-calendar-current { background: var(--dt-raised); box-shadow: inset 2px 0 0 var(--dt-accent-fill); }
#ailaw-weekly-lookahead .ailaw-calendar-current .ailaw-calendar-date,
#ailaw-weekly-lookahead .ailaw-calendar-current .ailaw-calendar-dayname { color: var(--dt-accent); }
#ailaw-weekly-lookahead .ailaw-calendar-past { background: transparent; opacity: 0.55; }

/* Archive links under the feeds */
#Daily_Digests > div[style*="padding-top:1em"] { font-family: var(--dt-mono); font-size: 0.8125rem !important; text-transform: lowercase; }

/* Section divider: a single rule */
.ailaw-section-divider { display: none !important; }

/* Latest case / legislation updates */
#ailaw-latest-updates { gap: 0 !important; border-top: 1px solid var(--dt-line); }
#ailaw-case-updates, #ailaw-legislation-updates { padding: 1.6em 1.75em 1.75em 0; }
#ailaw-legislation-updates { padding: 1.6em 0 1.75em 1.75em; border-left: 1px solid var(--dt-line); }
#ailaw-latest-updates h2 {
	font-family: var(--dt-mono) !important;
	font-size: 0.75rem !important;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-muted);
	border-bottom: 0 !important;
}
#ailaw-case-updates > h2::before, #ailaw-legislation-updates > h2::before { counter-increment: dt-sec; content: counter(dt-sec, decimal-leading-zero) " / "; color: var(--dt-accent); }
.ailaw-case-update, .ailaw-legislation-update { border-bottom-color: var(--dt-line-soft) !important; }
.ailaw-update-heading { font-size: 1.05em !important; font-weight: 600 !important; }
.ailaw-update-heading a { color: var(--dt-text); }
.ailaw-case-update > div, .ailaw-legislation-update > div { color: var(--dt-text-2); font-size: 0.9em; }

/* Status tags: existing label colours map to one tag system */
body #mw-content-text .ailaw-update-label {
	display: table !important;
	margin: 0 0 0.55em !important;
	padding: 0.15em 0.45em !important;
	border-radius: 0 !important;
	font-family: var(--dt-mono);
	font-size: 0.6875rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: transparent !important;
	color: var(--dt-text-2) !important;
	border: 1px solid var(--dt-line-strong);
}
body #mw-content-text .ailaw-update-label[style*="#f3eeff"] { background: var(--dt-accent-fill) !important; color: var(--dt-on-accent) !important; border-color: var(--dt-accent-fill); }
body #mw-content-text .ailaw-update-label[style*="#ebf4ff"] { color: var(--dt-info) !important; border-color: var(--dt-info); }

/* Opinions */
body #mw-content-text #ailaw-opinions {
	background: var(--dt-surface) !important;
	border: 1px solid var(--dt-line);
	border-top: 2px solid var(--dt-accent-fill);
	margin-top: 1.5em !important;
}
body #mw-content-text #ailaw-opinions h2#Opinions, body #mw-content-text #ailaw-opinions h2#Opinions a {
	font-family: var(--dt-mono) !important;
	font-size: 0.75rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-muted) !important;
}
#ailaw-opinions h2#Opinions::before { counter-increment: dt-sec; content: counter(dt-sec, decimal-leading-zero) " / "; color: var(--dt-accent); }
#ailaw-opinions div[aria-hidden="true"] { border-color: var(--dt-line) !important; }
#ailaw-opinions .ailaw-opinion-item h3, #ailaw-opinions .ailaw-opinion-item h3 a {
	font-family: var(--dt-sans) !important;
	font-weight: 500;
	font-size: 1.15rem;
	line-height: 1.3;
	color: var(--dt-text);
}
body #mw-content-text #ailaw-opinions .ailaw-opinion-item h3 + div { font-family: var(--dt-mono); font-weight: 400 !important; font-size: 0.6875rem !important; color: var(--dt-accent) !important; text-transform: uppercase; letter-spacing: 0.04em; }
#ailaw-opinions .ailaw-opinion-item h3 + div + div { color: var(--dt-text-2); }

/* Featured videos */
#ailaw-featured-video { border: 1px solid var(--dt-line); border-radius: 0; background: var(--dt-bg); }
#ailaw-featured-video > h2 {
	font-family: var(--dt-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-muted);
}
#ailaw-featured-video > h2::before { counter-increment: dt-sec; content: counter(dt-sec, decimal-leading-zero) " / "; color: var(--dt-accent); }
#ailaw-featured-video h3 { font-family: var(--dt-sans); font-weight: 500; color: var(--dt-text); }
#ailaw-featured-video .ailaw-featured-video-meta { font-family: var(--dt-mono); font-size: 0.6875rem; color: var(--dt-muted); text-transform: uppercase; letter-spacing: 0.04em; }
#ailaw-featured-video .ailaw-video-moments { background: var(--dt-surface); border: 1px solid var(--dt-line); }
#ailaw-featured-video .ailaw-video-moments h4 { font-family: var(--dt-mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dt-muted); }
#ailaw-featured-video .ailaw-video-moment + .ailaw-video-moment { border-color: var(--dt-line); }
#ailaw-featured-video .ailaw-video-time { font-family: var(--dt-mono); color: var(--dt-accent); }

/* "The reference library" heading block */
body.page-Main_Page #mw-content-text .mw-parser-output div[style*="border-top:2px solid #1a365d"] { border-top: 1px solid var(--dt-line) !important; padding-top: 1.6em !important; }
body.page-Main_Page #mw-content-text .mw-parser-output div[style*="border-top:2px solid #1a365d"] > div { font-family: var(--dt-mono); }
body.page-Main_Page #mw-content-text .mw-parser-output div[style*="border-top:2px solid #1a365d"] > div::before { counter-increment: dt-sec; content: counter(dt-sec, decimal-leading-zero) " / "; color: var(--dt-accent); }
body.page-Main_Page #mw-content-text .mw-parser-output div[style*="border-top:2px solid #1a365d"] > h2 {
	font-family: var(--dt-sans) !important;
	font-weight: 600;
	font-size: 2rem !important;
	letter-spacing: -0.02em;
	color: var(--dt-text) !important;
}

/* Library cards */
#ailaw-navigation-cards {
	gap: 1px !important;
	background: var(--dt-line);
	border: 1px solid var(--dt-line);
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)) !important;
}
#ailaw-navigation-cards > div {
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--dt-bg);
	padding: 1.2em 1.2em 1.3em !important;
}
#ailaw-navigation-cards > div > div:first-child { display: none; }
#ailaw-navigation-cards > div b,
#ailaw-navigation-cards > div > p:first-of-type b { font-family: var(--dt-mono); font-size: 1.05em; font-weight: 600; }
#ailaw-navigation-cards > div b a { color: var(--dt-text); text-transform: lowercase; }
#ailaw-navigation-cards > div b a::before { content: "/"; color: var(--dt-accent); }
#ailaw-navigation-cards > div > div[style*="color"] { color: var(--dt-muted) !important; margin-top: 0.4em; }
#ailaw-navigation-cards > div > div:last-child { font-family: var(--dt-mono); font-size: 0.75rem !important; text-transform: lowercase; }
#ailaw-navigation-cards > div:hover { background: var(--dt-surface); }

/* Litigation / Legislation / International / About panels */
body.page-Main_Page #mw-content-text .mw-parser-output table[style*="border-radius:12px"],
body.page-Main_Page #mw-content-text .mw-parser-output div[style*="border-radius:12px"] {
	border-radius: 0 !important;
	background: var(--dt-surface) !important;
	border: 1px solid var(--dt-line) !important;
}
body.page-Main_Page #mw-content-text .mw-parser-output table[style*="border-radius:12px"] > tbody > tr > td { background: transparent; }
body.page-Main_Page #mw-content-text .mw-parser-output :is(table, div)[style*="border-radius:12px"] h3 {
	font-family: var(--dt-mono) !important;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dt-text) !important;
}
body.page-Main_Page #mw-content-text .mw-parser-output :is(table, div)[style*="border-radius:12px"] h4 { font-family: var(--dt-sans); font-weight: 600; color: var(--dt-text); }
body.page-Main_Page #mw-content-text .mw-parser-output :is(table, div)[style*="border-radius:12px"] > tbody > tr > td > div:first-of-type,
body.page-Main_Page #mw-content-text .mw-parser-output :is(table, div)[style*="border-radius:12px"] h3 + div:not([style*="display:flex"]) { font-family: var(--dt-mono); font-size: 0.8125rem; line-height: 1.9; }

/* --------------------------------------------------------------------------
   12. Narrow screens
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
	#Daily_Digests.ailaw-digest-edition { display: block; }
	#Daily_Digests > #ailaw-weekly-lookahead { position: static; }
	#ailaw-legislation-updates { border-left: 0; padding-left: 0; }
	.ailaw-case-sidebar, .ailaw-legislation-information { position: static; }
}

@media print {
	html:root[class] { --dt-bg: #fff; --dt-surface: #fff; --dt-text: #000; --dt-text-2: #000; --dt-muted: #444; --dt-line: #bbb; }
	.mw-first-heading::before, .ailaw-lead-story h2::before { display: none !important; }
}

/* Preview section swap: Opinions beside the lead; calendar below the digest. */
html.docket-sections-swapped #Daily_Digests > #ailaw-opinions {
    grid-column: 2;
    grid-row: 1 / span 12;
    position: sticky;
    top: 4.5rem;
    min-width: 0;
    margin: 0 !important;
}
html.docket-sections-swapped #ailaw-opinions .ailaw-opinions-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1em !important;
}
html.docket-sections-swapped #ailaw-opinions .ailaw-opinions-copy { padding: 1em !important; }
html.docket-sections-swapped #ailaw-opinions .ailaw-opinion-item + .ailaw-opinion-item {
    border-top: 1px solid var(--dt-line-soft);
    padding-top: 1em !important;
}
html.docket-sections-swapped #ailaw-weekly-lookahead { margin-bottom: 1.5em !important; }
html.docket-sections-swapped #ailaw-weekly-lookahead .ailaw-calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
html.docket-sections-swapped #ailaw-weekly-lookahead .ailaw-calendar-day {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    border-bottom: 0;
    border-right: 1px solid var(--dt-line-soft);
}
html.docket-sections-swapped #ailaw-weekly-lookahead .ailaw-calendar-day:last-child { border-right: 0; }
html.docket-sections-swapped #ailaw-weekly-lookahead :is(.ailaw-calendar-dayname, .ailaw-calendar-date, .ailaw-calendar-event) {
    grid-column: 1 !important;
    grid-row: auto !important;
}
html.docket-sections-swapped #ailaw-weekly-lookahead .ailaw-calendar-date { margin: 0.25em 0 0.65em; }
@media (max-width: 1000px) {
    html.docket-sections-swapped #Daily_Digests > #ailaw-opinions {
        grid-column: 1;
        grid-row: auto;
        position: static;
        margin: 1.2em 0 !important;
    }
    html.docket-sections-swapped #ailaw-weekly-lookahead .ailaw-calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    html.docket-sections-swapped #ailaw-weekly-lookahead .ailaw-calendar-day:last-child { grid-column: 1 / -1; }
}
/* --------------------------------------------------------------------------
   Podcast card (#ailaw-podcast-card): solid amber block with waveform.
   Same look in night and day; only the edge changes (see the end of this block).
   Uses the theme's tokens: --dt-accent-fill (#FFB224), --dt-on-accent (#0A0C0F),
   --dt-mono, --dt-sans.
   -------------------------------------------------------------------------- */
body #mw-content-text #ailaw-podcast-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0 0 20px;
	padding: 18px 20px 16px;
	background: var(--dt-accent-fill, #ffb224);
	color: var(--dt-on-accent, #0a0c0f);
	border: 1px solid transparent;
	font-family: var(--dt-sans);
	line-height: 1.3;
}
#ailaw-podcast-card * { color: inherit; }

/* Kicker row: "● LISTEN · DAILY AUDIO BRIEFING" ........ "EP. 15" */
#ailaw-podcast-card .ailaw-podcast-kicker {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-family: var(--dt-mono);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
#ailaw-podcast-card .ailaw-podcast-kicker > span:first-child::before { content: "\25CF\00a0\00a0"; }

/* Title + date */
#ailaw-podcast-card .ailaw-podcast-title {
	font-size: 1.625rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.05;
}
#ailaw-podcast-card .ailaw-podcast-date {
	margin-top: -10px;
	font-family: var(--dt-mono);
	font-size: 0.8125rem;
	font-weight: 500;
}

/* Player row: square play button + waveform */
#ailaw-podcast-card .ailaw-podcast-player {
	display: flex;
	align-items: center;
	gap: 14px;
	height: 56px;
}
#ailaw-podcast-card .ailaw-podcast-play a {
	position: relative;
	display: block;
	width: 56px;
	height: 56px;
	flex: none;
	background: var(--dt-on-accent, #0a0c0f);
	font-size: 0;            /* link text stays for screen readers; the triangle is drawn below */
	text-decoration: none;
}
#ailaw-podcast-card .ailaw-podcast-play { flex: none; }
#ailaw-podcast-card .ailaw-podcast-play a::before {
	content: "";
	position: absolute;
	left: 21px;
	top: 17px;
	width: 18px;
	height: 22px;
	background: var(--dt-accent-fill, #ffb224);
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}
#ailaw-podcast-card .ailaw-podcast-play a::after { content: none !important; }
#ailaw-podcast-card .ailaw-podcast-play a:hover { background: #2a3138; }
#ailaw-podcast-card .ailaw-podcast-wave {
	flex: 1;
	min-width: 0;
	height: 56px;
	background: var(--dt-on-accent, #0a0c0f);
	opacity: 0.85;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 348 56' preserveAspectRatio='none'%3E%3Crect x='0' y='21' width='4' height='14'/%3E%3Crect x='8' y='17' width='4' height='22'/%3E%3Crect x='16' y='13' width='4' height='30'/%3E%3Crect x='24' y='19' width='4' height='18'/%3E%3Crect x='32' y='9' width='4' height='38'/%3E%3Crect x='40' y='15' width='4' height='26'/%3E%3Crect x='48' y='6' width='4' height='44'/%3E%3Crect x='56' y='11' width='4' height='34'/%3E%3Crect x='64' y='18' width='4' height='20'/%3E%3Crect x='72' y='14' width='4' height='28'/%3E%3Crect x='80' y='5' width='4' height='46'/%3E%3Crect x='88' y='8' width='4' height='40'/%3E%3Crect x='96' y='16' width='4' height='24'/%3E%3Crect x='104' y='20' width='4' height='16'/%3E%3Crect x='112' y='12' width='4' height='32'/%3E%3Crect x='120' y='7' width='4' height='42'/%3E%3Crect x='128' y='10' width='4' height='36'/%3E%3Crect x='136' y='17' width='4' height='22'/%3E%3Crect x='144' y='13' width='4' height='30'/%3E%3Crect x='152' y='4' width='4' height='48'/%3E%3Crect x='160' y='9' width='4' height='38'/%3E%3Crect x='168' y='15' width='4' height='26'/%3E%3Crect x='176' y='19' width='4' height='18'/%3E%3Crect x='184' y='11' width='4' height='34'/%3E%3Crect x='192' y='6' width='4' height='44'/%3E%3Crect x='200' y='14' width='4' height='28'/%3E%3Crect x='208' y='18' width='4' height='20'/%3E%3Crect x='216' y='10' width='4' height='36'/%3E%3Crect x='224' y='5' width='4' height='46'/%3E%3Crect x='232' y='13' width='4' height='30'/%3E%3Crect x='240' y='16' width='4' height='24'/%3E%3Crect x='248' y='8' width='4' height='40'/%3E%3Crect x='256' y='12' width='4' height='32'/%3E%3Crect x='264' y='19' width='4' height='18'/%3E%3Crect x='272' y='15' width='4' height='26'/%3E%3Crect x='280' y='7' width='4' height='42'/%3E%3Crect x='288' y='11' width='4' height='34'/%3E%3Crect x='296' y='17' width='4' height='22'/%3E%3Crect x='304' y='20' width='4' height='16'/%3E%3Crect x='312' y='14' width='4' height='28'/%3E%3Crect x='320' y='18' width='4' height='20'/%3E%3Crect x='328' y='22' width='4' height='12'/%3E%3Crect x='336' y='19' width='4' height='18'/%3E%3Crect x='344' y='23' width='4' height='10'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 348 56' preserveAspectRatio='none'%3E%3Crect x='0' y='21' width='4' height='14'/%3E%3Crect x='8' y='17' width='4' height='22'/%3E%3Crect x='16' y='13' width='4' height='30'/%3E%3Crect x='24' y='19' width='4' height='18'/%3E%3Crect x='32' y='9' width='4' height='38'/%3E%3Crect x='40' y='15' width='4' height='26'/%3E%3Crect x='48' y='6' width='4' height='44'/%3E%3Crect x='56' y='11' width='4' height='34'/%3E%3Crect x='64' y='18' width='4' height='20'/%3E%3Crect x='72' y='14' width='4' height='28'/%3E%3Crect x='80' y='5' width='4' height='46'/%3E%3Crect x='88' y='8' width='4' height='40'/%3E%3Crect x='96' y='16' width='4' height='24'/%3E%3Crect x='104' y='20' width='4' height='16'/%3E%3Crect x='112' y='12' width='4' height='32'/%3E%3Crect x='120' y='7' width='4' height='42'/%3E%3Crect x='128' y='10' width='4' height='36'/%3E%3Crect x='136' y='17' width='4' height='22'/%3E%3Crect x='144' y='13' width='4' height='30'/%3E%3Crect x='152' y='4' width='4' height='48'/%3E%3Crect x='160' y='9' width='4' height='38'/%3E%3Crect x='168' y='15' width='4' height='26'/%3E%3Crect x='176' y='19' width='4' height='18'/%3E%3Crect x='184' y='11' width='4' height='34'/%3E%3Crect x='192' y='6' width='4' height='44'/%3E%3Crect x='200' y='14' width='4' height='28'/%3E%3Crect x='208' y='18' width='4' height='20'/%3E%3Crect x='216' y='10' width='4' height='36'/%3E%3Crect x='224' y='5' width='4' height='46'/%3E%3Crect x='232' y='13' width='4' height='30'/%3E%3Crect x='240' y='16' width='4' height='24'/%3E%3Crect x='248' y='8' width='4' height='40'/%3E%3Crect x='256' y='12' width='4' height='32'/%3E%3Crect x='264' y='19' width='4' height='18'/%3E%3Crect x='272' y='15' width='4' height='26'/%3E%3Crect x='280' y='7' width='4' height='42'/%3E%3Crect x='288' y='11' width='4' height='34'/%3E%3Crect x='296' y='17' width='4' height='22'/%3E%3Crect x='304' y='20' width='4' height='16'/%3E%3Crect x='312' y='14' width='4' height='28'/%3E%3Crect x='320' y='18' width='4' height='20'/%3E%3Crect x='328' y='22' width='4' height='12'/%3E%3Crect x='336' y='19' width='4' height='18'/%3E%3Crect x='344' y='23' width='4' height='10'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* 00:00 ........ 10:32 */
#ailaw-podcast-card .ailaw-podcast-times {
	display: flex;
	justify-content: space-between;
	font-family: var(--dt-mono);
	font-size: 0.75rem;
	font-weight: 500;
}

/* "+ follow" ........ "all episodes →" */
#ailaw-podcast-card .ailaw-podcast-links {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding-top: 11px;
	border-top: 1px solid rgb(10 12 15 / 0.35);
	font-family: var(--dt-mono);
	font-size: 0.75rem;
	font-weight: 600;
}
#ailaw-podcast-card .ailaw-podcast-links a {
	color: var(--dt-on-accent, #0a0c0f) !important;
	text-decoration: none;
	padding: 6px 0;           /* taller tap target */
}
#ailaw-podcast-card .ailaw-podcast-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
#ailaw-podcast-card a.external { background-image: none; padding-right: 0; }
#ailaw-podcast-card a.external::after { content: none !important; }

/* Keyboard focus: dark ring, visible on amber in both modes */
#ailaw-podcast-card a:focus-visible { outline: 2px solid var(--dt-on-accent, #0a0c0f); outline-offset: 3px; }

/* Day (paper) only: a slightly deeper amber edge so the block doesn't bleed into the light page */
html.skin-theme-clientpref-day body #mw-content-text #ailaw-podcast-card { border-color: #d98f0b; }
@media screen and (prefers-color-scheme: light) {
	html.skin-theme-clientpref-os body #mw-content-text #ailaw-podcast-card { border-color: #d98f0b; }
}

/* Print: drop the card */
@media print { #ailaw-podcast-card { display: none !important; } }

/* Podcast + Opinions are one flowing sidebar, avoiding a tall sticky panel. */
html.docket-podcast-card-ready #Daily_Digests > .ailaw-editorial-sidebar {
    grid-column: 2;
    grid-row: 1 / span 12;
    min-width: 0;
    align-self: start;
}
html.docket-podcast-card-ready body #mw-content-text #ailaw-opinions { position: static; margin: 0 !important; }
@media (max-width: 1000px) {
    html.docket-podcast-card-ready #Daily_Digests > .ailaw-editorial-sidebar {
        grid-column: 1;
        grid-row: auto;
        margin-top: 1.25em;
    }
}

/* Native plainlinks clears link backgrounds; retain the actual play button. */
#ailaw-podcast-card .ailaw-podcast-play a { background-color: var(--dt-on-accent, #0a0c0f) !important; }
#ailaw-podcast-card .ailaw-podcast-play a:hover { background-color: #2a3138 !important; }
#ailaw-podcast-card .ailaw-podcast-ep { white-space: nowrap; flex: none; }
.ailaw-editorial-sidebar { container-type: inline-size; }
@container (max-width: 350px) {
    #ailaw-podcast-card .ailaw-podcast-kicker { font-size: 0.625rem; letter-spacing: 0.075em; }
}

/* --------------------------------------------------------------------------
   BREAKING ▶▶▶ : replaces the "LEAD" tag for extraordinary news.
   Switch it on by adding the class "ailaw-breaking" to the lead-story div:
     <div class="ailaw-lead-story ailaw-breaking" ...>
   Without that class the page is unchanged. Works in both theme files
   (desktop and mobile) and in night and day modes.

   How it works:
   - h2::before is the tag box. It reads "BREAKING" in red and leaves room on
     the right for the triangles.
   - h2::after draws the three triangles inside that room. They are a CSS mask
     (not text characters), so no device can render them as emoji or in a
     different font. A red band grows behind the mask: 0, 1, 2, 3 triangles lit,
     then reset, every 1.6 s. Unlit triangles show in dim red.
   -------------------------------------------------------------------------- */

/* Alert colour: red, separate from the theme's amber so it never reads as routine */
html.skin-theme-clientpref-night:root { --dt-alert: #ff5a4a; --dt-alert-dim: rgb(255 90 74 / 0.28); }
html.skin-theme-clientpref-day:root,
html.skin-theme-clientpref-os:root { --dt-alert: #c4291c; --dt-alert-dim: rgb(196 41 28 / 0.25); }
@media screen and (prefers-color-scheme: dark) {
	html.skin-theme-clientpref-os:root { --dt-alert: #ff5a4a; --dt-alert-dim: rgb(255 90 74 / 0.28); }
}

/* The tag box. Inherits size, font, padding and border from the theme's LEAD tag. */
body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking h2 { position: relative; }
body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking h2::before {
	/* !important: the live Main Page currently has an inline rule that hides
	   h2::before (including the LEAD tag) with !important. This selector is more
	   specific, so it wins when both are !important. */
	content: "Breaking" !important;
	content: "Breaking" / "Breaking news:" !important;   /* screen readers hear "Breaking news:" (ignored where unsupported) */
	display: block !important;
	color: var(--dt-alert);
	-webkit-text-fill-color: var(--dt-alert);
	border-color: var(--dt-alert);
	box-shadow: inset 3px 0 0 var(--dt-alert);
	padding-left: 0.65rem;
	padding-right: 3.3rem;          /* room for the triangles */
}

/* The triangles. Positioned from the tag's own metrics:
   left  = border 1px + padding 0.65rem + "BREAKING" (8 mono chars x 0.68em x 0.75rem = 4.08rem) + gap 0.55rem
   top   = border 1px + padding 0.2rem + (line box 0.765rem - 0.65rem) / 2 */
body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking h2::after {
	content: "";
	position: absolute;
	left: calc(1px + 0.65rem + 4.08rem + 0.55rem);
	top: calc(1px + 0.2rem + 0.0575rem);
	width: 2.3rem;
	height: 0.65rem;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 13'%3E%3Cpath d='M0 0L10 6.5L0 13zM18 0L28 6.5L18 13zM36 0L46 6.5L36 13z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 13'%3E%3Cpath d='M0 0L10 6.5L0 13zM18 0L28 6.5L18 13zM36 0L46 6.5L36 13z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	background: linear-gradient(var(--dt-alert), var(--dt-alert)) 0 0 / 0% 100% no-repeat, var(--dt-alert-dim);
	animation: dt-breaking-triangles 1.6s step-end infinite;
	pointer-events: none;
}
/* Band widths: triangle 1 ends at 10/46 (22%), 2 at 28/46 (61%), 3 at 100% */
@keyframes dt-breaking-triangles {
	0%   { background-size: 0% 100%, auto; }
	25%  { background-size: 23% 100%, auto; }
	50%  { background-size: 62% 100%, auto; }
	75%  { background-size: 100% 100%, auto; }
	100% { background-size: 100% 100%, auto; }
}

/* A thin alert rule above the whole lead story, so the change is visible at a glance */
body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking {
	box-shadow: inset 0 2px 0 var(--dt-alert);
	padding-top: 1.5em !important;
}

/* Respect "reduce motion": all three triangles solid, no animation */
@media (prefers-reduced-motion: reduce) {
	body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking h2::after {
		animation: none;
		background: var(--dt-alert);
	}
}

@media print {
	body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking h2::before {
		color: #000; -webkit-text-fill-color: #000; border-color: #000; box-shadow: inset 3px 0 0 #000;
	}
	body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking h2::after { animation: none; background: #000; }
	body #mw-content-text #Daily_Digests .ailaw-lead-story.ailaw-breaking { box-shadow: inset 0 2px 0 #000; }
}
