/**
 * CWV Audit Suite — admin styles.
 * Scoped under .cwv-wrap so nothing leaks into the rest of wp-admin.
 */

.cwv-wrap {
	--cwv-brand: #a01c1c;
	--cwv-brand-dark: #7d1515;
	--cwv-beige: #ddd5c8;
	--cwv-ink: #23201d;
	--cwv-muted: #6f6a65;
	--cwv-line: #e6e1db;
	--cwv-bg: #faf9f7;
	--cwv-good: #1e8449;
	--cwv-warn: #b7770d;
	--cwv-fail: #a01c1c;
	--cwv-good-bg: #e8f5ec;
	--cwv-warn-bg: #fdf4e0;
	--cwv-fail-bg: #fbeaea;
	--cwv-radius: 12px;
	--cwv-shadow: 0 1px 2px rgba(20, 16, 12, .05), 0 6px 18px rgba(20, 16, 12, .05);

	margin: 0 20px 40px 0;
	color: var(--cwv-ink);
	font-size: 14px;
}

.cwv-wrap * {
	box-sizing: border-box;
}

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

.cwv-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	padding: 26px 28px;
	margin: 20px 0 24px;
	border-radius: var(--cwv-radius);
	background: linear-gradient(120deg, #7d1515 0%, #a01c1c 55%, #b83232 100%);
	color: #fff;
	box-shadow: var(--cwv-shadow);
}

.cwv-header h1 {
	margin: 0 0 6px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	padding: 0;
}

.cwv-header p {
	margin: 0;
	font-size: 13.5px;
	opacity: .85;
	max-width: 70ch;
}

.cwv-header .cwv-header-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.cwv-eyebrow {
	font-size: 11px;
	letter-spacing: 2.4px;
	text-transform: uppercase;
	opacity: .72;
	margin-bottom: 6px;
	display: block;
}

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

.cwv-card {
	background: #fff;
	border: 1px solid var(--cwv-line);
	border-radius: var(--cwv-radius);
	box-shadow: var(--cwv-shadow);
	margin-bottom: 20px;
	overflow: hidden;
}

.cwv-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 16px 20px;
	border-bottom: 1px solid var(--cwv-line);
	background: var(--cwv-bg);
}

.cwv-card-head h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	padding: 0;
}

.cwv-card-head p {
	margin: 3px 0 0;
	font-size: 12.5px;
	color: var(--cwv-muted);
}

.cwv-card-body {
	padding: 20px;
}

.cwv-card-body.is-flush {
	padding: 0;
}

/* ------------------------------------------------------------ stat tiles */

.cwv-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 16px;
	margin-bottom: 22px;
}

.cwv-stat {
	background: #fff;
	border: 1px solid var(--cwv-line);
	border-radius: var(--cwv-radius);
	box-shadow: var(--cwv-shadow);
	padding: 18px 20px;
}

.cwv-stat-label {
	font-size: 11px;
	letter-spacing: 1.1px;
	text-transform: uppercase;
	color: var(--cwv-muted);
	font-weight: 700;
}

.cwv-stat-value {
	font-size: 30px;
	font-weight: 800;
	line-height: 1.15;
	margin-top: 6px;
}

.cwv-stat-sub {
	font-size: 12px;
	color: var(--cwv-muted);
	margin-top: 4px;
}

/* ----------------------------------------------------------- score rings */

.cwv-rings {
	display: flex;
	gap: 28px;
	flex-wrap: wrap;
	align-items: center;
}

.cwv-ring {
	text-align: center;
}

.cwv-ring-dial {
	--cwv-value: 0;
	--cwv-color: var(--cwv-fail);
	position: relative;
	width: 104px;
	height: 104px;
	border-radius: 50%;
	background: conic-gradient(var(--cwv-color) calc(var(--cwv-value) * 1%), #ece7e0 0);
	display: grid;
	place-items: center;
	margin: 0 auto 8px;
}

.cwv-ring-dial::after {
	content: "";
	position: absolute;
	inset: 9px;
	border-radius: 50%;
	background: #fff;
}

.cwv-ring-value {
	position: relative;
	z-index: 1;
	font-size: 26px;
	font-weight: 800;
	line-height: 1;
}

.cwv-ring-label {
	font-size: 12px;
	color: var(--cwv-muted);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .8px;
}

.cwv-ring-target {
	font-size: 11.5px;
	color: var(--cwv-muted);
	margin-top: 2px;
}

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

.cwv-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}

.cwv-table th {
	text-align: left;
	font-size: 11px;
	letter-spacing: .8px;
	text-transform: uppercase;
	color: var(--cwv-muted);
	font-weight: 700;
	padding: 12px 18px;
	background: var(--cwv-bg);
	border-bottom: 1px solid var(--cwv-line);
	white-space: nowrap;
}

.cwv-table td {
	padding: 13px 18px;
	border-bottom: 1px solid var(--cwv-line);
	vertical-align: middle;
}

.cwv-table tbody tr:last-child td {
	border-bottom: 0;
}

.cwv-table tbody tr:hover td {
	background: #fcfbfa;
}

.cwv-table .cwv-num {
	text-align: center;
	white-space: nowrap;
}

.cwv-table .cwv-row-actions {
	text-align: right;
	white-space: nowrap;
}

.cwv-primary-cell {
	font-weight: 600;
}

.cwv-sub {
	display: block;
	font-size: 12px;
	color: var(--cwv-muted);
	font-weight: 400;
	margin-top: 2px;
	word-break: break-all;
}

/* ----------------------------------------------------------- score chips */

.cwv-score {
	display: inline-block;
	min-width: 40px;
	padding: 4px 10px;
	border-radius: 8px;
	font-weight: 700;
	color: #fff;
	font-size: 13px;
	text-align: center;
}

.cwv-score.score-good { background: var(--cwv-good); }
.cwv-score.score-warn { background: var(--cwv-warn); }
.cwv-score.score-fail { background: var(--cwv-fail); }
.cwv-score.is-empty { background: #d9d4ce; color: #6f6a65; }

.cwv-chip {
	display: inline-block;
	padding: 4px 11px;
	border-radius: 20px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .2px;
}

.cwv-chip-ok { background: var(--cwv-good-bg); color: var(--cwv-good); }
.cwv-chip-busy { background: #e8f0fb; color: #1c5ba8; }
.cwv-chip-bad { background: var(--cwv-fail-bg); color: var(--cwv-fail); }
.cwv-chip-warn { background: var(--cwv-warn-bg); color: var(--cwv-warn); }
.cwv-chip-muted { background: #eeebe7; color: var(--cwv-muted); }

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

.cwv-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 16px;
	border-radius: 9px;
	border: 1px solid var(--cwv-line);
	background: #fff;
	color: var(--cwv-ink);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.cwv-btn:hover {
	background: var(--cwv-bg);
	color: var(--cwv-ink);
	border-color: #d5cec6;
}

.cwv-btn:active { transform: translateY(1px); }

.cwv-btn:focus {
	outline: 2px solid var(--cwv-brand);
	outline-offset: 1px;
}

.cwv-btn-primary {
	background: var(--cwv-brand);
	border-color: var(--cwv-brand);
	color: #fff;
}

.cwv-btn-primary:hover {
	background: var(--cwv-brand-dark);
	border-color: var(--cwv-brand-dark);
	color: #fff;
}

.cwv-btn-ghost {
	background: rgba(255, 255, 255, .14);
	border-color: rgba(255, 255, 255, .35);
	color: #fff;
}

.cwv-btn-ghost:hover {
	background: rgba(255, 255, 255, .24);
	color: #fff;
	border-color: rgba(255, 255, 255, .5);
}

.cwv-btn-danger {
	color: var(--cwv-fail);
	border-color: #ecd7d7;
}

.cwv-btn-danger:hover {
	background: var(--cwv-fail-bg);
	color: var(--cwv-fail);
}

.cwv-btn-sm {
	padding: 6px 12px;
	font-size: 12.5px;
}

.cwv-btn[disabled],
.cwv-btn.is-busy {
	opacity: .6;
	pointer-events: none;
}

.cwv-btn-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

/* ----------------------------------------------------------------- forms */

.cwv-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 18px 22px;
}

.cwv-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cwv-field.is-wide {
	grid-column: 1 / -1;
}

.cwv-field label {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--cwv-ink);
}

.cwv-field input[type="text"],
.cwv-field input[type="url"],
.cwv-field input[type="email"],
.cwv-field input[type="number"],
.cwv-field input[type="password"],
.cwv-field textarea,
.cwv-field select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--cwv-line);
	border-radius: 9px;
	background: #fff;
	font-size: 13.5px;
	color: var(--cwv-ink);
	box-shadow: none;
	min-height: 0;
}

.cwv-field input:focus,
.cwv-field textarea:focus,
.cwv-field select:focus {
	border-color: var(--cwv-brand);
	box-shadow: 0 0 0 2px rgba(160, 28, 28, .12);
	outline: none;
}

.cwv-field textarea {
	min-height: 90px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
	line-height: 1.5;
}

.cwv-field .cwv-help {
	font-size: 12px;
	color: var(--cwv-muted);
	line-height: 1.5;
}

.cwv-field .cwv-help code {
	background: var(--cwv-bg);
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 11.5px;
}

.cwv-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 13px;
	font-weight: 500;
}

.cwv-checkbox input {
	margin-top: 2px;
}

.cwv-section-title {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--cwv-brand);
	margin: 4px 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--cwv-line);
}

.cwv-form-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 16px 20px;
	background: var(--cwv-bg);
	border-top: 1px solid var(--cwv-line);
}

/* -------------------------------------------------------------- progress */

.cwv-progress-shell {
	background: #fff;
	border: 1px solid var(--cwv-line);
	border-radius: var(--cwv-radius);
	box-shadow: var(--cwv-shadow);
	padding: 24px;
	margin-bottom: 20px;
}

.cwv-progress-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.cwv-progress-step {
	font-size: 16px;
	font-weight: 700;
}

.cwv-progress-detail {
	font-size: 12.5px;
	color: var(--cwv-muted);
	margin-top: 3px;
}

.cwv-progress-percent {
	font-size: 26px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.cwv-progress-bar {
	height: 10px;
	border-radius: 6px;
	background: #ece7e0;
	overflow: hidden;
}

.cwv-progress-fill {
	height: 100%;
	width: 0;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--cwv-brand) 0%, #d05353 100%);
	transition: width .4s ease;
}

.cwv-progress-fill.is-done {
	background: linear-gradient(90deg, var(--cwv-good) 0%, #4bb377 100%);
}

.cwv-progress-fill.is-failed {
	background: #8d8681;
}

/* steps list */

.cwv-steps {
	display: grid;
	gap: 8px;
	margin-top: 20px;
}

.cwv-step {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border: 1px solid var(--cwv-line);
	border-radius: 10px;
	font-size: 13px;
	background: #fff;
}

.cwv-step-num {
	flex: 0 0 26px;
	height: 26px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 12px;
	font-weight: 800;
	background: #ece7e0;
	color: var(--cwv-muted);
}

.cwv-step.is-active {
	border-color: var(--cwv-brand);
	background: #fdf7f7;
}

.cwv-step.is-active .cwv-step-num {
	background: var(--cwv-brand);
	color: #fff;
}

.cwv-step.is-done .cwv-step-num {
	background: var(--cwv-good);
	color: #fff;
}

.cwv-step-label {
	font-weight: 600;
}

.cwv-step-state {
	margin-left: auto;
	font-size: 11.5px;
	color: var(--cwv-muted);
	font-weight: 600;
}

/* ------------------------------------------------------------- log panel */

.cwv-log {
	background: #1e1b19;
	color: #ded8d1;
	border-radius: 10px;
	padding: 14px 16px;
	max-height: 340px;
	overflow-y: auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	line-height: 1.65;
}

.cwv-log-line {
	display: flex;
	gap: 10px;
	padding: 1px 0;
	word-break: break-word;
}

.cwv-log-time {
	color: #7d7671;
	flex: 0 0 60px;
}

.cwv-log-line.level-success .cwv-log-msg { color: #7fd8a0; }
.cwv-log-line.level-warn .cwv-log-msg { color: #f0c674; }
.cwv-log-line.level-error .cwv-log-msg { color: #f08a8a; }

.cwv-log-empty {
	color: #7d7671;
	font-style: italic;
}

/* ---------------------------------------------------------------- pieces */

.cwv-grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 20px;
	align-items: start;
}

.cwv-empty {
	text-align: center;
	padding: 52px 24px;
	color: var(--cwv-muted);
}

.cwv-empty h3 {
	margin: 0 0 6px;
	font-size: 16px;
	color: var(--cwv-ink);
}

.cwv-empty p {
	margin: 0 auto 18px;
	max-width: 46ch;
	font-size: 13.5px;
}

.cwv-kv {
	display: grid;
	grid-template-columns: minmax(120px, auto) 1fr;
	gap: 8px 18px;
	font-size: 13px;
}

.cwv-kv dt {
	color: var(--cwv-muted);
	font-weight: 600;
}

.cwv-kv dd {
	margin: 0;
	word-break: break-word;
}

.cwv-item {
	border: 1px solid var(--cwv-line);
	border-left-width: 4px;
	border-radius: 0 10px 10px 0;
	padding: 13px 16px;
	margin-bottom: 10px;
	background: #fff;
}

.cwv-item:last-child { margin-bottom: 0; }
.cwv-item.priority-high { border-left-color: var(--cwv-fail); }
.cwv-item.priority-medium { border-left-color: var(--cwv-warn); }
.cwv-item.priority-low { border-left-color: var(--cwv-good); }

.cwv-item-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 5px;
}

.cwv-item-title {
	font-weight: 700;
	font-size: 13.5px;
}

.cwv-item-meta {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
	flex-wrap: wrap;
}

.cwv-item-detail {
	font-size: 13px;
	color: #55524f;
	line-height: 1.6;
}

.cwv-tag {
	font-size: 11px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 20px;
	background: #eeebe7;
	color: var(--cwv-muted);
	white-space: nowrap;
}

/* ---------------------------------------------------------- suggestions */

.cwv-suggest-heading {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 18px 0 8px;
	font-size: 14px;
}

.cwv-suggest-heading:first-child {
	margin-top: 0;
}

.cwv-suggest {
	border: 1px solid var(--cwv-line);
	border-radius: 9px;
	padding: 10px 14px;
	margin-bottom: 8px;
	background: #fff;
}

.cwv-suggest summary {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	cursor: pointer;
	list-style: none;
}

.cwv-suggest summary::-webkit-details-marker {
	display: none;
}

.cwv-suggest-title {
	font-weight: 700;
	font-size: 13.5px;
}

.cwv-suggest-title::before {
	content: "▸ ";
	color: var(--cwv-muted);
}

.cwv-suggest[open] .cwv-suggest-title::before {
	content: "▾ ";
}

.cwv-suggest-urls {
	margin: 8px 0 0;
	padding-left: 18px;
	font-size: 12.5px;
	word-break: break-all;
}

.cwv-suggest-urls li {
	margin-bottom: 3px;
}

.cwv-inline-form {
	display: inline;
}

.cwv-notice-inline {
	padding: 11px 15px;
	border-radius: 9px;
	font-size: 13px;
	margin-bottom: 16px;
	border: 1px solid;
}

.cwv-notice-inline.is-warn {
	background: var(--cwv-warn-bg);
	border-color: #f0dcb2;
	color: #7a5108;
}

.cwv-notice-inline.is-error {
	background: var(--cwv-fail-bg);
	border-color: #eccaca;
	color: #7d1515;
}

.cwv-notice-inline.is-ok {
	background: var(--cwv-good-bg);
	border-color: #c7e5d2;
	color: #146135;
}

.cwv-test-result {
	font-size: 12.5px;
	margin-top: 6px;
	min-height: 18px;
}

.cwv-test-result.is-ok { color: var(--cwv-good); }
.cwv-test-result.is-error { color: var(--cwv-fail); }

.cwv-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--cwv-line);
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.cwv-tab {
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cwv-muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.cwv-tab:hover { color: var(--cwv-ink); }

.cwv-tab.is-active {
	color: var(--cwv-brand);
	border-bottom-color: var(--cwv-brand);
}

.cwv-spinner {
	display: inline-block;
	width: 13px;
	height: 13px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cwv-spin .7s linear infinite;
}

.cwv-btn:not(.cwv-btn-primary) .cwv-spinner {
	border-color: rgba(0, 0, 0, .15);
	border-top-color: var(--cwv-brand);
}

@keyframes cwv-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.cwv-spinner { animation-duration: 2s; }
	.cwv-progress-fill { transition: none; }
}

/* ---------------------------------------------------------------- trends */

.cwv-wrap .cwv-trend-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.cwv-wrap .cwv-trend-controls select {
	height: 32px;
	padding: 0 8px;
	border: 1px solid var(--cwv-line);
	border-radius: 8px;
	background: #fff;
	color: var(--cwv-ink);
	font-size: 13px;
	max-width: 160px;
}

.cwv-wrap .cwv-metric-picker {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.cwv-wrap .cwv-metric-picker .cwv-btn.is-active {
	background: var(--cwv-brand);
	border-color: var(--cwv-brand);
	color: #fff;
}

.cwv-wrap .cwv-chart {
	position: relative;
	width: 100%;
	min-height: 200px;
}

.cwv-wrap .cwv-chart-svg {
	display: block;
	width: 100%;
	height: 240px;
	overflow: visible;
}

.cwv-wrap .cwv-chart-svg + .cwv-chart-caption + .cwv-chart-svg {
	height: 120px;
}

.cwv-wrap .cwv-chart-caption {
	margin: 14px 0 2px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--cwv-muted);
}

.cwv-wrap .cwv-chart-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 200px;
	border: 1px dashed var(--cwv-line);
	border-radius: var(--cwv-radius);
	color: var(--cwv-muted);
	font-size: 13px;
}

.cwv-wrap [data-cwv-trends].is-loading .cwv-chart,
.cwv-wrap [data-cwv-url-trends].is-loading .cwv-chart,
.cwv-wrap [data-cwv-url-trends].is-loading .cwv-table {
	opacity: .45;
	transition: opacity .15s ease;
}

/* ---------------------------------------------------------------- client bar

   The Trends screen is about one client at a time, so the selected client gets
   an identity strip of its own rather than being a line in a card heading. */
.cwv-wrap .cwv-client-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 18px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--cwv-line);
	border-left: 4px solid var(--cwv-brand);
	border-radius: var(--cwv-radius);
	box-shadow: var(--cwv-shadow);
}

.cwv-wrap .cwv-client-id h2 {
	margin: 0;
	font-size: 20px;
	line-height: 1.2;
}

.cwv-wrap .cwv-client-url {
	display: inline-block;
	margin-top: 2px;
	color: var(--cwv-muted);
	font-size: 13px;
	text-decoration: none;
}

.cwv-wrap .cwv-client-url:hover {
	color: var(--cwv-brand);
	text-decoration: underline;
}

.cwv-wrap .cwv-client-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 10px;
	color: var(--cwv-muted);
	font-size: 12px;
}

.cwv-wrap .cwv-client-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* ------------------------------------------------------------- chart legend

   Clickable chips under a multi-series chart. The dot is filled when the series
   is drawn and hollow when it is hidden, so the chip reads correctly without
   relying on the text colour alone. */
.cwv-wrap .cwv-chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.cwv-wrap .cwv-legend-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	max-width: 100%;
	padding: 4px 10px;
	background: #fff;
	border: 1px solid var(--cwv-line);
	border-radius: 999px;
	color: var(--cwv-muted);
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.cwv-wrap .cwv-legend-chip:hover {
	border-color: #cfc7bd;
}

.cwv-wrap .cwv-legend-chip.is-on {
	background: var(--cwv-bg);
	border-color: #cfc7bd;
	color: var(--cwv-ink);
}

.cwv-wrap .cwv-legend-dot {
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	border: 2px solid currentColor;
	border-radius: 50%;
}

.cwv-wrap .cwv-legend-label {
	overflow: hidden;
	max-width: 220px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cwv-wrap .cwv-legend-value {
	color: var(--cwv-muted);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.cwv-wrap .cwv-legend-chip.is-on .cwv-legend-value {
	color: var(--cwv-ink);
}

/* Deltas: green for improvement, red for regression, whichever direction the
   underlying metric improves in. */
.cwv-wrap .cwv-delta {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	background: #eeebe7;
	color: var(--cwv-muted);
}

.cwv-wrap .cwv-delta.is-up { background: var(--cwv-good-bg); color: var(--cwv-good); }
.cwv-wrap .cwv-delta.is-down { background: var(--cwv-fail-bg); color: var(--cwv-fail); }
.cwv-wrap .cwv-delta.is-flat,
.cwv-wrap .cwv-delta.is-unknown { background: #eeebe7; color: var(--cwv-muted); }

.cwv-wrap .cwv-table tr.is-empty-row td {
	background: #fcfbfa;
	color: var(--cwv-muted);
}

.cwv-wrap select[multiple] {
	width: 100%;
	padding: 6px;
	border: 1px solid var(--cwv-line);
	border-radius: 8px;
	background: #fff;
}

/* ------------------------------------------------------------- schedules */

.cwv-schedule-box {
	border: 1px solid var(--cwv-line);
	border-radius: 9px;
	padding: 14px 16px;
	background: #fff;
}

.cwv-schedule-box h3 {
	margin: 0 0 4px;
	font-size: 14px;
}

.cwv-schedule-box [hidden] {
	display: none;
}

.cwv-schedule-cost {
	margin: 12px 0 0;
	padding: 8px 12px;
	border-radius: 7px;
	background: var(--cwv-bg);
	font-size: 12.5px;
	font-weight: 600;
}

.cwv-schedule-others {
	margin: 0;
	padding-left: 18px;
	font-size: 13px;
}

.cwv-schedule-others li {
	margin-bottom: 4px;
}

/* ------------------------------------------------------ menu URL helper */

.cwv-url-helper {
	margin-top: 10px;
	border: 1px dashed var(--cwv-line);
	border-radius: 9px;
	padding: 8px 12px;
	background: var(--cwv-bg);
}

.cwv-url-helper summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 13px;
}

.cwv-url-helper-body {
	margin-top: 10px;
}

.cwv-helper-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
}

.cwv-code-row {
	display: flex;
	gap: 8px;
	align-items: flex-start;
}

.cwv-wrap textarea.cwv-code {
	flex: 1 1 auto;
	min-width: 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	line-height: 1.5;
	white-space: pre;
	overflow: auto;
	background: #1f1d1b;
	color: #f3efe9;
	border-radius: 7px;
}

.cwv-helper-steps {
	margin: 8px 0 0;
	padding-left: 20px;
	font-size: 12.5px;
	color: var(--cwv-muted);
}

.cwv-helper-steps li {
	margin-bottom: 2px;
}

@media (max-width: 600px) {
	.cwv-code-row {
		flex-direction: column;
	}
}

/* ------------------------------------------------- AI evidence & sources */

.cwv-proof {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
	font-size: 11.5px;
}

.cwv-evidence {
	padding: 2px 8px;
	border-radius: 6px;
	background: var(--cwv-bg);
	border: 1px solid var(--cwv-line);
}

.cwv-evidence code {
	font-size: 11px;
	background: none;
	padding: 0;
}

.cwv-ref {
	padding: 2px 8px;
	border-radius: 6px;
	background: #eef3fb;
	color: #24508f;
	text-decoration: none;
}

.cwv-ref:hover {
	text-decoration: underline;
}

.cwv-source {
	white-space: nowrap;
}

.cwv-gaps {
	margin-top: 10px;
}

.cwv-regression.is-changed {
	border-left: 4px solid var(--cwv-warn);
}

.cwv-regression-headline {
	font-weight: 600;
	color: var(--cwv-ink) !important;
}

.cwv-cause.confidence-high { border-left-color: var(--cwv-fail); }
.cwv-cause.confidence-medium { border-left-color: var(--cwv-warn); }
.cwv-cause.confidence-low { border-left-color: var(--cwv-line); }

tr:target,
.cwv-suggest:target {
	outline: 2px solid var(--cwv-warn);
	outline-offset: -2px;
}

/* ---------------------------------------------------------------- alerts */

.cwv-alert-body summary {
	cursor: pointer;
	font-size: 12px;
	color: var(--cwv-muted);
	margin-top: 4px;
}

.cwv-alert-body pre {
	white-space: pre-wrap;
	font-size: 12px;
	background: var(--cwv-bg);
	border: 1px solid var(--cwv-line);
	border-radius: 7px;
	padding: 10px;
	margin: 6px 0 0;
	max-width: 640px;
}

.cwv-badge {
	display: inline-block;
	min-width: 18px;
	padding: 0 6px;
	margin-left: 4px;
	border-radius: 9px;
	background: var(--cwv-fail);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}
