/**
 * Workflow Render — viewer styles.
 *
 * Scoped under .acc-wkf-app so nothing here leaks into the theme, and the
 * theme's article styles cannot reach into the canvas.
 */

.acc-wkf-app {
	--wkf-bg: #eceff2;
	--wkf-panel: #ffffff;
	--wkf-ink: #20242b;
	--wkf-muted: #6a7280;
	--wkf-line: #d8dde3;
	--wkf-accent: #185fa5;
	--wkf-accent-soft: #e6f0fb;
	--wkf-canvas: #f4f5f7;
	--wkf-code: #f6f8fa;

	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: var(--wkf-bg);
	color: var(--wkf-ink);
	font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	overflow: hidden;
	z-index: 1;
}

/* Header ------------------------------------------------------------- */

.acc-wkf-app header {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 8px 14px;
	background: var(--wkf-panel);
	border-bottom: 1px solid var(--wkf-line);
}

.acc-wkf-app header h1 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.acc-wkf-app header h1 a {
	color: inherit;
	text-decoration: none;
}

.acc-wkf-meta {
	font-size: 11.5px;
	color: var(--wkf-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.acc-wkf-spacer {
	flex: 1;
}

.acc-wkf-app button,
.acc-wkf-app select,
.acc-wkf-app input[type="text"] {
	font: inherit;
	font-size: 12px;
	padding: 5px 11px;
	border: 1px solid var(--wkf-line);
	border-radius: 6px;
	background: var(--wkf-panel);
	color: var(--wkf-ink);
}

.acc-wkf-app button {
	cursor: pointer;
}

.acc-wkf-app button:hover {
	background: #f2f5f8;
	border-color: #c3cad2;
}

.acc-wkf-app button.primary {
	background: var(--wkf-accent);
	border-color: var(--wkf-accent);
	color: #fff;
}

.acc-wkf-app button.primary:hover {
	background: #144d86;
}

/* Input ------------------------------------------------------------- */

.acc-wkf-input {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	overflow: auto;
}

.acc-wkf-input textarea {
	flex: 1;
	min-height: 260px;
	width: 100%;
	padding: 10px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11.5px;
	color: #2a2f37;
	background: var(--wkf-code);
	border: 1px solid var(--wkf-line);
	border-radius: 8px;
	resize: none;
}

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

.acc-wkf-privacy {
	font-size: 12px;
	color: var(--wkf-muted);
	max-width: 70ch;
}

.acc-wkf-status {
	font-size: 12px;
	color: var(--wkf-muted);
}

.acc-wkf-status.err {
	color: #a3271f;
}

.acc-wkf-status.ok {
	color: #1e6b3a;
}

/* Canvas ------------------------------------------------------------ */

.acc-wkf-canvas {
	position: relative;
	flex: 1;
	background: var(--wkf-canvas);
	overflow: hidden;
}

.acc-wkf-canvas svg {
	display: block;
	width: 100%;
	height: 100%;
	cursor: grab;
	touch-action: none;   /* we handle pan and pinch ourselves */
}

.acc-wkf-canvas svg.panning {
	cursor: grabbing;
}

/* Only the hit rect takes taps; everything painted is inert, so no icon,
   label or decoration can swallow a touch before it reaches the node. */
.acc-wkf-node {
	cursor: pointer;
}

.acc-wkf-node > * {
	pointer-events: none;
}

.acc-wkf-node > .acc-wkf-hit {
	pointer-events: all;
}

.acc-wkf-sel {
	transition: fill 0.12s;
}

.acc-wkf-node:hover .acc-wkf-sel {
	fill: rgba(24, 96, 165, 0.08);
}

.acc-wkf-node.sel .acc-wkf-sel {
	fill: rgba(24, 96, 165, 0.16);
	stroke: var(--wkf-accent);
	stroke-width: 2;
}

/* Bottom right, clear of consent widgets which conventionally sit bottom left. */
.acc-wkf-zoom {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: flex;
	gap: 4px;
	padding: 4px;
	background: var(--wkf-panel);
	border: 1px solid var(--wkf-line);
	border-radius: 8px;
}

.acc-wkf-pct {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	padding: 0 4px;
	font-size: 11.5px;
	color: var(--wkf-muted);
}

.acc-wkf-pct input {
	width: 34px;
	padding: 3px 2px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	font: inherit;
	font-size: 11.5px;
	text-align: right;
	color: var(--wkf-ink);
}

.acc-wkf-pct input:hover,
.acc-wkf-pct input:focus {
	border-color: var(--wkf-line);
	background: #fff;
	outline: none;
}

.acc-wkf-zoom button {
	border: none;
	padding: 4px 9px;
	background: transparent;
}

.acc-wkf-hint {
	position: absolute;
	right: 12px;
	bottom: 56px;
	padding: 4px 8px;
	font-size: 11px;
	color: var(--wkf-muted);
	background: var(--wkf-panel);
	border: 1px solid var(--wkf-line);
	border-radius: 6px;
}

.acc-wkf-linkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: var(--wkf-accent-soft);
	border-bottom: 1px solid #cfe1f5;
	font-size: 12px;
}

.acc-wkf-linkbox input {
	flex: 1;
	max-width: 520px;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11.5px;
}

/* Modal ------------------------------------------------------------- */

.acc-wkf-modal {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(18, 22, 28, 0.45);
}

.acc-wkf-modal.open {
	display: flex;
}

.acc-wkf-modal .panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(720px, 94vw);
	max-height: 86vh;
	min-height: 0;
	overflow: hidden;
	background: var(--wkf-panel);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* The inspector HTML is injected into this wrapper; it must be the constrained
   flex column, or the body inside it has no height to scroll against. */
#acc-wkf-modal-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.acc-wkf-head {
	flex-shrink: 0;
}

.acc-wkf-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 16px;
	line-height: 1;
	color: var(--wkf-muted);
}

/* Inspector content ------------------------------------------------- */

.acc-wkf-head {
	padding: 12px 14px;
	border-bottom: 1px solid var(--wkf-line);
}

.acc-wkf-kind {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 3px 9px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.2px;
	color: #fff;
}

.acc-wkf-head h2 {
	margin: 8px 0 2px;
	font-size: 15px;
	font-weight: 600;
	word-break: break-word;
}

.acc-wkf-sub {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11.5px;
	color: var(--wkf-muted);
}

.acc-wkf-body {
	flex: 1;
	min-height: 0;        /* lets the body shrink inside the flex panel so it can scroll */
	padding: 14px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.acc-wkf-sec {
	margin-bottom: 18px;
}

.acc-wkf-lbl {
	margin-bottom: 8px;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--wkf-line);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--wkf-accent);
}

.acc-wkf-kv {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: 3px 10px;
	margin: 0;
	font-size: 12px;
}

.acc-wkf-kv dt {
	color: var(--wkf-muted);
}

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

.acc-wkf-pill {
	display: inline-block;
	padding: 1px 7px;
	border: 1px solid #cfe1f5;
	border-radius: 5px;
	background: var(--wkf-accent-soft);
	color: var(--wkf-accent);
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11.5px;
}

.acc-wkf-mono {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11.5px;
}

.acc-wkf-human {
	padding: 8px 10px;
	border: 1px solid #d6e9d9;
	border-radius: 6px;
	background: #f2f8f3;
	color: #2f5233;
	font-size: 12px;
	font-style: italic;
}

.acc-wkf-note,
.acc-wkf-line {
	font-size: 11.5px;
	margin-top: 4px;
}

.acc-wkf-note {
	color: var(--wkf-muted);
}

.acc-wkf-muted {
	color: var(--wkf-muted);
}

/* Condition table, laid out like the client's Filter panel */

.acc-wkf-chead,
.acc-wkf-crow {
	display: grid;
	grid-template-columns: 48px 1fr 96px 1fr;
}

.acc-wkf-chead {
	padding-bottom: 4px;
	border-bottom: 1px solid var(--wkf-line);
	font-size: 10.5px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: var(--wkf-muted);
}

.acc-wkf-crow {
	align-items: start;
	padding: 5px 0;
	border-bottom: 1px solid #eef1f4;
}

.acc-wkf-bool {
	font-size: 11px;
	font-weight: 600;
	color: #c07a1a;
}

.acc-wkf-expr {
	padding-right: 8px;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11.5px;
	word-break: break-word;
}

.acc-wkf-op {
	font-size: 11.5px;
	color: var(--wkf-muted);
}

.acc-wkf-val {
	font-size: 11.5px;
	word-break: break-word;
}

.acc-wkf-param {
	color: #7a4fb0;
}

.acc-wkf-lit {
	color: #1a7a4a;
}

.acc-wkf-cgroup {
	margin: 4px 0;
	padding-left: 10px;
	border-left: 2px solid #e0d3b3;
}

.acc-wkf-ghead {
	margin: 4px 0;
	font-size: 11px;
	font-weight: 600;
	color: #8a6a1a;
}

.acc-wkf-tag {
	display: inline-block;
	margin-left: 6px;
	padding: 0 6px;
	border: 1px solid var(--wkf-line);
	border-radius: 4px;
	background: #eef1f4;
	font-size: 10.5px;
	color: var(--wkf-muted);
}

.acc-wkf-tag.off {
	border-color: #e3c9c9;
	background: #f3e6e6;
	color: #a3271f;
}

.acc-wkf-tag.pre {
	border-color: #f0d9b0;
	background: #fff5e6;
	color: #8a5a10;
}

.acc-wkf-cols {
	width: 100%;
	border-collapse: collapse;
	font-size: 11.5px;
}

.acc-wkf-cols th {
	padding: 4px 6px;
	border-bottom: 1px solid var(--wkf-line);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	text-align: left;
	color: var(--wkf-muted);
}

.acc-wkf-cols td {
	padding: 4px 6px;
	border-bottom: 1px solid #eef1f4;
	vertical-align: top;
	font-family: ui-monospace, Menlo, Consolas, monospace;
}

.acc-wkf-cols td.lab {
	font-family: inherit;
	color: var(--wkf-muted);
}

.acc-wkf-code {
	max-height: 320px;
	margin: 0;
	padding: 10px;
	overflow: auto;
	border: 1px solid var(--wkf-line);
	border-radius: 6px;
	background: var(--wkf-code);
	font-size: 11px;
	white-space: pre;
	color: #2a2f37;
}

.acc-wkf-warn {
	padding: 8px 10px;
	border: 1px solid #e6c3c0;
	border-radius: 6px;
	background: #fdecec;
	color: #a3271f;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11.5px;
	white-space: pre-wrap;
}

.acc-wkf-out {
	margin-bottom: 8px;
	padding: 10px;
	border: 1px solid var(--wkf-line);
	border-radius: 7px;
	background: #fafbfc;
}

.acc-wkf-oh {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 600;
}

.acc-wkf-arrow {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 11px;
	color: var(--wkf-muted);
}

.acc-wkf-trlist {
	font-size: 12px;
}

.acc-wkf-tr {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 0;
	border-bottom: 1px solid #eef1f4;
}

.acc-wkf-tk {
	min-width: 90px;
	font-size: 10.5px;
	color: var(--wkf-muted);
}

.acc-wkf-goto {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	color: var(--wkf-accent);
	text-decoration: none;
}

.acc-wkf-goto:hover {
	text-decoration: underline;
}

.acc-wkf-body details summary {
	padding: 4px 0;
	cursor: pointer;
	color: var(--wkf-accent);
	font-size: 11.5px;
}

/* Expired / error share page ---------------------------------------- */

.acc-wkf-gone {
	margin: auto;
	max-width: 460px;
	padding: 28px;
	text-align: center;
}

.acc-wkf-gone h2 {
	margin: 0 0 8px;
	font-size: 18px;
}

.acc-wkf-gone p {
	color: var(--wkf-muted);
}

@media (max-width: 640px) {
	.acc-wkf-kv {
		grid-template-columns: 1fr;
	}

	.acc-wkf-chead,
	.acc-wkf-crow {
		grid-template-columns: 40px 1fr;
	}

	.acc-wkf-op,
	.acc-wkf-val {
		grid-column: 2;
	}
}


/* Touch / small screens -------------------------------------------- */

@media (max-width: 640px) {
	.acc-wkf-app header {
		gap: 8px;
		padding: 8px 10px;
	}

	.acc-wkf-app header h1 {
		font-size: 14px;
	}

	.acc-wkf-meta {
		flex-basis: 100%;
		order: 5;
	}

	.acc-wkf-app button,
	.acc-wkf-app select,
	.acc-wkf-app input[type="text"] {
		padding: 8px 12px;   /* comfortable finger targets */
		font-size: 13px;
	}

	.acc-wkf-zoom button {
		padding: 8px 12px;
		font-size: 16px;
	}

	.acc-wkf-pct input {
		width: 40px;
		padding: 6px 2px;
		font-size: 13px;
	}

	.acc-wkf-modal {
		padding: 0;
		align-items: flex-end;   /* sheet slides up from the bottom */
	}

	.acc-wkf-modal .panel {
		width: 100%;
		max-height: 90vh;
		border-radius: 14px 14px 0 0;
	}

	.acc-wkf-close {
		width: 34px;
		height: 34px;
		font-size: 20px;
	}

	.acc-wkf-hint {
		display: none;   /* the gesture hint is desktop wording */
	}

	.acc-wkf-input {
		padding: 12px;
	}
}
