/* ==========================================================================
   AcceGuru - front-end scan panel

   Styles for the panel the admin bar button opens on a live page. The
   markup is built in assets/js/acceguru-highlighter.js; every rule here is
   scoped to the panel's own id so a theme cannot reach inside it, and the
   panel cannot leak onto the site.

   Colours, type, spacing and shapes follow the approved panel design.
   Fonts come from assets/fonts/acceguru-fonts.css (self-hosted).
   ========================================================================== */

#a11y-overlay-panel {
	--acceguru-navy: #05386e;
	--acceguru-mint: #2fbe8b;
	--acceguru-red: #ed3237;
	--acceguru-orange: #e07b1f;
	--acceguru-orange-dot: #f4923f;
	--acceguru-yellow: #f6c445;
	--acceguru-blue: #2271b1;
	--acceguru-indigo: #ac22c3;
	--acceguru-grey: #676c71;
	--acceguru-line: #e6e7e8;
	--acceguru-line-soft: #f1f1f2;
	--acceguru-band: #f9f9f9;
	--acceguru-band-soft: #fbfbfb;
	--acceguru-tip: #eef7f1;
	--acceguru-body: #363738;

	position: fixed;
	top: 32px;
	width: 360px;
	/* Per cent, not vw: 100vw counts the scrollbar, so on a narrow screen
	   with one the panel would hang a scrollbar's width off the edge. */
	max-width: 100%;
	height: calc(100vh - 32px);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	color: var(--acceguru-navy);
	font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: 13px;
	line-height: 1.45;
	box-sizing: border-box;
}

#a11y-overlay-panel *,
#a11y-overlay-panel *::before,
#a11y-overlay-panel *::after {
	box-sizing: border-box;
}

/* Theme isolation. The panel sits inside the site's own page, so a theme's
   rules for headings, buttons, links and lists reach into it. A panel that
   changes shape from theme to theme is not one a user can rely on, so every
   tag inside starts from the same neutral state. These selectors are
   element-level, so every class rule in this file still wins; a theme's
   rules, which almost never carry an id, do not. */
#a11y-overlay-panel h1,
#a11y-overlay-panel h2,
#a11y-overlay-panel h3,
#a11y-overlay-panel h4,
#a11y-overlay-panel h5,
#a11y-overlay-panel h6,
#a11y-overlay-panel p,
#a11y-overlay-panel ul,
#a11y-overlay-panel ol,
#a11y-overlay-panel li,
#a11y-overlay-panel pre,
#a11y-overlay-panel figure,
#a11y-overlay-panel section,
#a11y-overlay-panel div,
#a11y-overlay-panel span,
#a11y-overlay-panel button,
#a11y-overlay-panel a,
#a11y-overlay-panel img,
#a11y-overlay-panel svg {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	letter-spacing: normal;
	word-spacing: normal;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
	list-style: none;
	border-radius: 0;
	box-shadow: none;
	width: auto;
	height: auto;
	max-width: none;
	position: static;
	transform: none;
	opacity: 1;
	min-width: 0;
	float: none !important;
	text-indent: 0 !important;
	text-shadow: none !important;
	min-height: 0 !important;
}

#a11y-overlay-panel strong {
	font-weight: 600;
}

#a11y-overlay-panel img,
#a11y-overlay-panel svg {
	display: block;
	flex: none;
}

/* Icons carry their size in the markup, so nothing in this file sets it.
   That makes !important safe here, and it keeps a theme that resizes every
   svg on the site from resizing the panel's icons with it. */
#a11y-overlay-panel svg {
	width: auto !important;
	height: auto !important;
}

/* Themes routinely ship `button { white-space: nowrap }` with !important
   (Hello Elementor among them), which would push every row's label onto one
   clipped line. Nothing in this file wraps a button in nowrap, so the guard
   is safe; the one label that must stay on a line is a span inside its
   button and keeps its own rule. */
#a11y-overlay-panel button,
#a11y-overlay-panel a {
	white-space: normal !important;
}

#a11y-overlay-panel.acceguru-panel--right {
	right: 0;
	border-left: 1px solid var(--acceguru-grey);
	box-shadow: -2px 0 8px rgba(0, 0, 0, .12);
}

#a11y-overlay-panel.acceguru-panel--left {
	left: 0;
	border-right: 1px solid var(--acceguru-grey);
	box-shadow: 2px 0 8px rgba(0, 0, 0, .12);
}

#a11y-overlay-panel button {
	font-family: inherit;
	color: inherit;
	cursor: pointer;
}

/* !important and a negative offset on purpose. The focus-outline fixer
   paints every focusable element on the page with an !important ring set
   3px outside the element, which on a full-width panel row runs past both
   panel edges. This rule wins that fight and keeps the ring inside the
   row. Navy on the panel's white reads at 11.7:1. */
#a11y-overlay-panel :focus-visible {
	outline: 2px solid var(--acceguru-navy) !important;
	outline-offset: -2px !important;
}

#a11y-overlay-panel .acceguru-code-wrap[hidden],
#a11y-overlay-panel [hidden] {
	display: none !important;
}

#a11y-overlay-panel .acceguru-code-wrap {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* --- header ------------------------------------------------------------ */

#a11y-overlay-panel .acceguru-panel__header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	padding: 14px 18px;
	background: var(--acceguru-line-soft);
}

#a11y-overlay-panel .acceguru-panel__icon {
	width: 28px;
	height: 28px;
	flex: none;
	display: block;
}

#a11y-overlay-panel .acceguru-panel__title {
	font-weight: 800;
	font-size: 19px;
	letter-spacing: -0.02em;
	margin: 0;
	/* "AcceGuru PRO" is a name, not a sentence: it stays on one line. */
	white-space: nowrap;
}

#a11y-overlay-panel .acceguru-panel__version,
#a11y-overlay-panel .acceguru-panel__pro {
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-weight: 600;
	font-size: 10px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 3px 5px;
	border-radius: 4px;
	background: var(--acceguru-mint);
	color: #fff;
}

#a11y-overlay-panel .acceguru-panel__spacer {
	flex: 1;
}

#a11y-overlay-panel .acceguru-panel__menu-btn {
	width: 26px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: -4px;
}

#a11y-overlay-panel .acceguru-panel__menu-btn:hover {
	background: var(--acceguru-line);
}

#a11y-overlay-panel .acceguru-panel__menu {
	position: absolute;
	top: 46px;
	right: 44px;
	min-width: 190px;
	z-index: 10;
	display: flex;
	flex-direction: column;
	padding: 4px;
	background: #fff;
	border: 1px solid var(--acceguru-line);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

#a11y-overlay-panel .acceguru-panel__menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 36px;
	padding: 0 10px;
	border: 0;
	background: transparent;
	color: var(--acceguru-grey);
	font-size: 14px;
	font-weight: 500;
	text-align: left;
	text-decoration: none;
}

#a11y-overlay-panel .acceguru-panel__menu-item:hover {
	background: var(--acceguru-line-soft);
}

#a11y-overlay-panel .acceguru-panel__close {
	width: 28px;
	height: 28px;
	border: 0;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
}

#a11y-overlay-panel .acceguru-panel__close:hover {
	background: var(--acceguru-line-soft);
}

/* --- current scan ------------------------------------------------------ */

#a11y-overlay-panel .acceguru-scan {
	flex: 0 0 auto;
	padding: 20px 18px 18px;
	position: relative;
}

#a11y-overlay-panel .acceguru-kicker {
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--acceguru-grey);
}

/* A long post title is cut after two lines with an ellipsis; the full name
   stays available as the element's tooltip. */
#a11y-overlay-panel .acceguru-scan__title {
	font-weight: 500;
	font-size: 18px;
	line-height: 1.15;
	letter-spacing: -0.025em;
	margin: 8px 0 0;
	overflow-wrap: break-word;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

#a11y-overlay-panel .acceguru-scan__stats {
	display: flex;
	align-items: flex-end;
	gap: 18px;
	margin-top: 18px;
}

#a11y-overlay-panel .acceguru-stat {
	flex: none;
}

#a11y-overlay-panel .acceguru-stat__value {
	font-weight: 800;
	font-size: 40px;
	line-height: 1;
	letter-spacing: -0.04em;
}

#a11y-overlay-panel .acceguru-stat__value--issues {
	color: var(--acceguru-red);
}

#a11y-overlay-panel .acceguru-stat__value--manual {
	color: var(--acceguru-indigo);
}

#a11y-overlay-panel .acceguru-stat__divider {
	width: 2px;
	align-self: stretch;
	background: var(--acceguru-line);
}

#a11y-overlay-panel .acceguru-rescan {
	position: absolute;
	/* Sits on the numbers line, five pixels above their baseline block so
	   the circle reads level with the figures next to it. */
	bottom: 23px;
	right: 18px;
	height: 33px;
	padding: 0;
	border: 0;
	border-radius: 17px;
	background: var(--acceguru-mint);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: background .15s ease;
}

#a11y-overlay-panel .acceguru-rescan:hover {
	background: #28a87a;
}

#a11y-overlay-panel .acceguru-rescan__icon {
	flex: none;
	width: 33px;
	height: 33px;
	display: flex;
	align-items: center;
	justify-content: center;
}

#a11y-overlay-panel .acceguru-rescan__label {
	padding-left: 14px;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* --- panes and their tabs ---------------------------------------------- */

/* The strip appears only when an add-on registered a second pane; on its
   own the free panel has one pane and no tabs at all. */
#a11y-overlay-panel .acceguru-tabs {
	display: flex;
	flex: 0 0 auto;
	border-bottom: 1px solid var(--acceguru-line);
}

#a11y-overlay-panel .acceguru-tab {
	flex: 1;
	padding: 13px 18px;
	border: 0;
	background: transparent;
	font-family: 'Archivo', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: -0.025em;
	text-transform: uppercase;
	text-align: center;
	color: var(--acceguru-grey);
}

#a11y-overlay-panel .acceguru-tab:hover {
	color: var(--acceguru-navy);
}

#a11y-overlay-panel .acceguru-tab[aria-selected="true"] {
	font-weight: 800;
	color: var(--acceguru-navy);
	box-shadow: inset 0 -3px 0 var(--acceguru-mint);
}

#a11y-overlay-panel .acceguru-pane {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

#a11y-overlay-panel .acceguru-pane[hidden] {
	display: none !important;
}

/* --- scrolling results ------------------------------------------------- */

#a11y-overlay-panel .acceguru-results {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
}

#a11y-overlay-panel .acceguru-note {
	margin: 0;
	padding: 18px;
	font-size: 13px;
	color: #00733c;
}

#a11y-overlay-panel .acceguru-foot {
	flex: 0 0 auto;
	padding: 16px 18px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--acceguru-grey);
}

/* --- severity group ---------------------------------------------------- */

#a11y-overlay-panel .acceguru-group__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	background: var(--acceguru-band);
	border-top: 1px solid var(--acceguru-line);
	border-bottom: 1px solid var(--acceguru-line);
}

#a11y-overlay-panel .acceguru-group__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: block;
	flex: none;
}

#a11y-overlay-panel .acceguru-group__label {
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

#a11y-overlay-panel .acceguru-group__count {
	margin-left: auto;
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--acceguru-grey);
}

/* --- category row ------------------------------------------------------ */

#a11y-overlay-panel .acceguru-cat__btn {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 18px 12px 0;
	border: 0;
	border-bottom: 1px solid var(--acceguru-line-soft);
	background: transparent;
	text-align: left;
}

#a11y-overlay-panel .acceguru-cat__btn:hover {
	background: var(--acceguru-band);
}

#a11y-overlay-panel .acceguru-cat__bar {
	width: 4px;
	align-self: stretch;
	background: var(--acceguru-line);
	flex: none;
}

#a11y-overlay-panel .acceguru-cat__btn[aria-expanded="true"] .acceguru-cat__bar {
	background: var(--acceguru-mint);
}

#a11y-overlay-panel .acceguru-cat__name {
	flex: 1;
	font-weight: 600;
	font-size: 14px;
	letter-spacing: -0.01em;
	overflow-wrap: break-word;
}

#a11y-overlay-panel .acceguru-cat__count {
	font-weight: 800;
	font-size: 17px;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

#a11y-overlay-panel .acceguru-arrow {
	flex: none;
	transition: transform .15s ease;
}

#a11y-overlay-panel [aria-expanded="true"] > .acceguru-arrow {
	transform: rotate(180deg);
}

/* --- rule row and its details ------------------------------------------ */

#a11y-overlay-panel .acceguru-rule {
	border-bottom: 1px solid var(--acceguru-line);
	background: var(--acceguru-band-soft);
}

#a11y-overlay-panel .acceguru-rule__btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 18px 8px 22px;
	border: 0;
	background: transparent;
	text-align: left;
}

#a11y-overlay-panel .acceguru-rule__btn:hover {
	background: var(--acceguru-band);
}

#a11y-overlay-panel .acceguru-rule__name {
	flex: 1;
	font-size: 13.5px;
	overflow-wrap: break-word;
}

#a11y-overlay-panel .acceguru-rule__count {
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--acceguru-grey);
	font-variant-numeric: tabular-nums;
}

#a11y-overlay-panel .acceguru-details {
	padding: 6px 18px 16px 22px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	border-top: 1px solid var(--acceguru-line);
}

#a11y-overlay-panel .acceguru-details__head {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: -0.01em;
	margin-bottom: 4px;
}

#a11y-overlay-panel .acceguru-info {
	display: inline-flex;
	position: relative;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--acceguru-grey);
}

#a11y-overlay-panel .acceguru-info__tip {
	position: absolute;
	left: 0;
	top: 22px;
	width: 200px;
	max-width: calc(360px - 68px);
	z-index: 5;
	padding: 8px 10px;
	background: #fff;
	color: var(--acceguru-navy);
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
	border: 1px solid var(--acceguru-line);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

#a11y-overlay-panel .acceguru-info__tip[hidden] {
	display: none;
}

/* Plain body text in the reference. The medium navy face belongs to the
   info tip that the little i opens, not to this line. */
#a11y-overlay-panel .acceguru-details__desc {
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--acceguru-body);
}

#a11y-overlay-panel .acceguru-badges {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

#a11y-overlay-panel .acceguru-badge {
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 3px 9px;
	background: #f0f0f0;
	color: var(--acceguru-grey);
}

#a11y-overlay-panel .acceguru-badge--wcag {
	background: #dceefb;
	color: #2a6f9e;
}

#a11y-overlay-panel .acceguru-badge--508 {
	background: #fbe4cf;
	color: #a3661f;
}

#a11y-overlay-panel .acceguru-badge--en {
	background: #fbe9ee;
	color: #a3486a;
}

#a11y-overlay-panel .acceguru-details__link {
	font-weight: 600;
	font-size: 13px;
	letter-spacing: -0.01em;
	color: var(--acceguru-mint);
	text-decoration: none;
	align-self: flex-start;
}

#a11y-overlay-panel .acceguru-details__link:hover {
	text-decoration: underline;
}

#a11y-overlay-panel .acceguru-hint {
	margin: 0;
	padding: 8px 10px;
	background: var(--acceguru-tip);
	color: var(--acceguru-grey);
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
}

#a11y-overlay-panel .acceguru-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

#a11y-overlay-panel .acceguru-action {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0;
	border: 0;
	background: transparent;
	font-family: 'Archivo Narrow', system-ui, sans-serif;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--acceguru-grey);
}

#a11y-overlay-panel .acceguru-action:hover {
	color: var(--acceguru-mint);
}

#a11y-overlay-panel .acceguru-action__code {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 13px;
}

#a11y-overlay-panel .acceguru-code {
	margin: 0;
	padding: 8px 10px;
	background: var(--acceguru-body);
	border-left: 3px solid var(--acceguru-line);
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 12px;
	line-height: 1.5;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	color: #fff;
}

/* Same dark slab; the mint edge is what marks the selector apart from the
   markup it points at. Declared after the block above so it wins the edge. */
#a11y-overlay-panel .acceguru-code--selector {
	border-left-color: var(--acceguru-mint);
}

/* --- manual checks ----------------------------------------------------- */

#a11y-overlay-panel .acceguru-manual {
	flex: 0 0 auto;
	background: var(--acceguru-band-soft);
	border-top: 1px solid var(--acceguru-line);
	border-bottom: 1px solid var(--acceguru-line);
}

#a11y-overlay-panel .acceguru-manual__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 12px 18px;
	border: 0;
	background: transparent;
	font-size: 14px;
	font-weight: 700;
	color: var(--acceguru-navy);
	text-align: left;
}

#a11y-overlay-panel .acceguru-manual__flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--acceguru-indigo);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	font-family: 'Archivo Narrow', system-ui, sans-serif;
}

/* No height cap and no scroll box of its own: the block now lives inside the
   panel's one scrolling area. */
#a11y-overlay-panel .acceguru-manual__list {
	overflow-x: hidden;
}


/* --- narrow screens ---------------------------------------------------- */

@media ( max-width: 480px ) {
	#a11y-overlay-panel {
		width: 100%;
	}

	#a11y-overlay-panel .acceguru-info__tip {
		max-width: calc(100% - 44px);
	}
}
