.irr-cleanup-widget {
	--ink:        #172033;
	--muted:      #667085;
	--line:       #d9e2ec;
	--panel-2:    #f8fafc;
	--head-bg:    #eef4fb;
	--blue:       #175cd3;
	--blue-soft:  #eff8ff;
	--green:      #067647;
	--green-soft: #ecfdf3;
	--amber:      #b54708;
	--amber-soft: #fffaeb;
	--red:        #b42318;
	--red-soft:   #fef3f2;
	--shadow:     0 18px 50px rgba(15, 23, 42, .08);
	--radius:     18px;

	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--ink);
	max-width: 100%;
}

.irr-cleanup-widget * {
	box-sizing: border-box;
}

/* ── Shared card base ───────────────────────────────── */

.irr-hero,
.irr-panel,
.irr-table-card,
.irr-detail-panel,
.irr-metric-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

/* ── Hero ───────────────────────────────────────────── */

.irr-hero {
	padding: 22px;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 18px;
	align-items: start;
	margin-bottom: 16px;
}

.irr-eyebrow {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .08em;
	font-weight: 800;
	color: var(--blue);
}

.irr-title {
	font-size: clamp(24px, 4vw, 36px);
	font-weight: 950;
	line-height: 1.05;
	margin: 7px 0 8px;
}

.irr-lede {
	max-width: 700px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.55;
	margin: 0;
}

.irr-source {
	color: var(--muted);
	font-size: 12px;
	text-align: right;
}

.irr-source a {
	color: var(--blue);
	font-weight: 700;
	text-decoration: none;
}

/* ── Form panel ─────────────────────────────────────── */

.irr-panel {
	padding: 16px;
	margin-bottom: 16px;
}

.irr-controls {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 10px;
	align-items: stretch;
}

.irr-controls textarea {
	min-height: 76px;
	resize: vertical;
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 13px 14px;
	font: inherit;
	background: #fff;
	color: var(--ink);
}

.irr-controls button {
	cursor: pointer;
	font: inherit;
	font-weight: 800;
	background: var(--ink);
	border: 1px solid var(--ink);
	border-radius: 14px;
	padding: 13px 16px;
	color: #fff;
	white-space: nowrap;
}

.irr-controls button:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.irr-controls button.secondary {
	background: #fff;
	color: var(--ink);
	border-color: var(--line);
}

.irr-status {
	min-height: 20px;
	margin-top: 10px;
	color: var(--muted);
	font-size: 13px;
}

/* ── Metrics ────────────────────────────────────────── */

.irr-metrics {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.irr-metric-card {
	padding: 15px;
}

.irr-metric-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: var(--muted);
	font-weight: 800;
}

.irr-metric-value {
	font-size: 24px;
	font-weight: 900;
	margin-top: 6px;
}

.irr-metric-hint {
	font-size: 12px;
	color: var(--muted);
	margin-top: 4px;
}

/* ── Table card ─────────────────────────────────────── */

.irr-table-card,
.irr-detail-panel {
	margin-bottom: 16px;
	overflow: hidden;
}

.irr-table-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--panel-2);
	border-bottom: 1px solid var(--line);
}

.irr-table-title {
	font-weight: 900;
}

.irr-table-note {
	font-size: 12px;
	color: var(--muted);
}

.irr-table-scroll {
	overflow: auto;
}

/* ── Rows / grid ────────────────────────────────────── */

.irr-grid {
	min-width: 1080px;
}

.irr-row {
	display: grid;
	grid-template-columns: 1.05fr .48fr .55fr .68fr .85fr 1.35fr .72fr;
	border-top: 1px solid #e7edf3;
}

.irr-row:first-child {
	border-top: 0;
}

.irr-row.irr-header {
	background: var(--head-bg);
	color: #475467;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .06em;
	font-weight: 900;
}

.irr-cell {
	padding: 11px 12px;
	border-left: 1px solid #e7edf3;
	font-size: 13px;
	line-height: 1.35;
}

.irr-cell:first-child {
	border-left: 0;
}

.irr-mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-weight: 850;
}

/* ── Pills ──────────────────────────────────────────── */

.irr-pill {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 4px 8px;
	margin: 2px 3px 2px 0;
	font-size: 11px;
	font-weight: 850;
	border: 1px solid transparent;
}

.irr-pill.blue   { background: var(--blue-soft);  color: var(--blue);  border-color: #b2ddff; }
.irr-pill.green  { background: var(--green-soft); color: var(--green); border-color: #abefc6; }
.irr-pill.amber  { background: var(--amber-soft); color: var(--amber); border-color: #fedf89; }
.irr-pill.red    { background: var(--red-soft);   color: var(--red);   border-color: #fecdca; }
.irr-pill.gray   { background: #f2f4f7;           color: #475467;      border-color: #d0d5dd; }

.irr-empty {
	color: #98a2b3;
}

/* ── IRR source lines ───────────────────────────────── */

.irr-source-line {
	margin: 0 0 6px;
}

.irr-source-line b {
	color: #344054;
}

/* ── Email button ───────────────────────────────────── */

.irr-mail {
	display: inline-flex;
	text-decoration: none;
	border-radius: 12px;
	padding: 8px 10px;
	background: var(--ink);
	color: #fff;
	font-weight: 850;
	font-size: 12px;
}

.irr-mail.off {
	background: #eef2f6;
	color: #667085;
	pointer-events: none;
}

/* ── Messages ───────────────────────────────────────── */

.irr-messages {
	display: grid;
	gap: 8px;
	margin: 12px 0;
}

.irr-msg {
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 11px 12px;
	background: #fff;
	font-size: 13px;
}

.irr-msg.warning { border-color: #fedf89; background: #fffaeb; color: #93370d; }
.irr-msg.danger  { border-color: #fecdca; background: #fef3f2; color: #912018; }
.irr-msg.success { border-color: #abefc6; background: #ecfdf3; color: #05603a; }

/* ── Evidence / detail panel ────────────────────────── */

.irr-detail-body {
	padding: 12px 16px;
	border-top: 1px solid #e7edf3;
}

.irr-detail-body:first-child {
	border-top: 0;
}

.irr-detail-summary {
	cursor: pointer;
	color: var(--blue);
	font-weight: 800;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.irr-rpsl {
	white-space: pre-wrap;
	background: #111827;
	color: #e5e7eb;
	border-radius: 12px;
	padding: 12px;
	max-height: 300px;
	overflow: auto;
	font-size: 12px;
	margin-top: 8px;
}

.irr-routes-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	margin-top: 8px;
}

.irr-routes-table th,
.irr-routes-table td {
	text-align: left;
	padding: 7px 10px;
	border-bottom: 1px solid #e7edf3;
}

.irr-routes-table th {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #475467;
	font-weight: 900;
	background: var(--head-bg);
}

/* ── Footer ─────────────────────────────────────────── */

.irr-footer {
	color: var(--muted);
	font-size: 12px;
	margin-top: 4px;
}

.irr-footer a {
	color: var(--blue);
	font-weight: 750;
	text-decoration: none;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 860px) {
	.irr-hero {
		grid-template-columns: 1fr;
	}

	.irr-source {
		text-align: left;
	}

	.irr-controls {
		grid-template-columns: 1fr;
	}

	.irr-metrics {
		grid-template-columns: 1fr 1fr;
	}

	.irr-grid {
		min-width: 0;
	}

	.irr-row {
		grid-template-columns: 1fr;
	}

	.irr-row.irr-header {
		display: none;
	}

	.irr-cell {
		border-left: 0;
		border-top: 1px solid #e7edf3;
	}

	.irr-cell::before {
		content: attr(data-label);
		display: block;
		font-size: 10px;
		letter-spacing: .07em;
		text-transform: uppercase;
		color: #98a2b3;
		font-weight: 900;
		margin-bottom: 4px;
	}
}
