/* Dosije: an editorial research tool. Paper, ink and a terracotta accent; serif headlines, a plain sans for data.
   Motion budget: a short fade for new rows, a pale highlight that fades on new findings. Nothing pulses for long. */

:root {
	/* the side margin of the start screen: the headline and the source strip line up on it */
	--page-gutter: clamp(24px, 6vw, 112px);
	/* paper and ink */
	--bg: #f4f1ea;
	--paper: #f4f1ea;
	--sunk: #ece7dc;
	--surface: #fffefb;
	--hover: #faf7f1;
	--ink: #1f2528;
	--ink-2: #454b4e;
	--ink-3: #686e70;
	--ink-4: #8d9294;
	--rule: #e3ddd1;
	--rule-strong: #cdc5b6;
	/* accent: terracotta / copper */
	--accent: #8f5944;
	--accent-ink: #6f4130;
	--accent-tint: #f4e9e2;
	--accent-soft: #b5664a;
	/* earth tones */
	--gold: #9a7a33;
	--olive: #5f6b3c;
	--slate: #3f5866;
	--slate-tint: #e6ecee;
	/* states */
	--ok: #2f6b47;
	--ok-ink: #25573a;
	--ok-tint: #e6efe7;
	--wait: #a26511;
	--wait-ink: #85500b;
	--wait-tint: #f8edd8;
	--warn: #a26511;
	--warn-tint: #f8edd8;
	--signal: #a8321f;
	--signal-ink: #8c2817;
	--signal-tint: #f6e3de;
	--think: #ddd6c9;
	--highlight: #fbefcb;
	/* shape */
	--radius: 10px;
	--radius-sm: 7px;
	--shadow-xs: 0 1px 1px rgba(41, 33, 20, 0.05);
	--shadow: 0 1px 2px rgba(41, 33, 20, 0.06), 0 2px 8px -4px rgba(41, 33, 20, 0.08);
	--shadow-lg: 0 22px 48px -22px rgba(41, 33, 20, 0.35), 0 3px 10px rgba(41, 33, 20, 0.06);
	/* type */
	--sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--display: "Source Serif 4", "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
	--doc-serif: "Source Serif 4", "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
	--mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* {
	box-sizing: border-box;
}
html,
body {
	height: 100%;
	margin: 0;
}
body {
	background: var(--bg);
	color: var(--ink);
	font: 15px/1.55 var(--sans);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
* {
	scrollbar-width: thin;
	scrollbar-color: var(--rule-strong) transparent;
}
[hidden] {
	display: none !important;
}
button {
	font: inherit;
	color: inherit;
}
h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd {
	margin: 0;
}
ol,
ul {
	padding: 0;
	list-style: none;
}
a {
	color: var(--accent-ink);
	text-underline-offset: 2px;
}
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
.lane:focus-visible,
.sig-row:focus-visible,
.tab:focus-visible,
.mtoggle:focus-visible,
.ev-list:focus-visible,
.live-list:focus-visible,
.drawer-toggle:focus-visible,
.task-head:focus-visible,
.ent:focus-visible,
.doc:focus-visible {
	outline-offset: -2px;
}
.doc:focus {
	outline: none;
}
input[type="text"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: none;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.skip {
	position: absolute;
	left: 8px;
	top: -48px;
	z-index: 100;
	padding: 8px 12px;
	background: var(--ink);
	color: #fff;
	border-radius: 0 0 8px 8px;
	text-decoration: none;
}
.skip:focus {
	top: 0;
}

/* ─── shared bits ───────────────────────────────────────────────────────── */

.label,
.eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-3);
	letter-spacing: 0.01em;
}
.serif-title {
	font: 600 30px/1.18 var(--display);
	letter-spacing: -0.01em;
	color: var(--ink);
	overflow-wrap: anywhere;
}
.serif-title.sm {
	font-size: 22px;
}
.sec-title {
	display: flex;
	align-items: center;
	gap: 9px;
	font: 600 19px/1.3 var(--display);
	color: var(--ink);
}
.sec-title.sm {
	font-size: 17px;
}
.count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 21px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--sunk);
	color: var(--ink-2);
	font: 600 12px/1 var(--sans);
	font-variant-numeric: tabular-nums;
}
.empty-line {
	padding: 14px 0;
	font-size: 14px;
	color: var(--ink-3);
}
.disclaimer {
	font-size: 13px;
	color: var(--ink-3);
	text-align: center;
	padding: 4px 0 8px;
}
.lede {
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--ink-2);
}
.card {
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	box-shadow: var(--shadow-xs);
}
.card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px 8px;
}
.card-hint {
	font-size: 13px;
	color: var(--ink-3);
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 38px;
	padding: 0 16px;
	border: 1px solid var(--rule-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--ink);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover:not(:disabled) {
	background: var(--hover);
	border-color: var(--ink-4);
}
.btn.primary {
	background: var(--ink);
	border-color: var(--ink);
	color: #fbf8f2;
}
.btn.primary:hover:not(:disabled) {
	background: var(--accent-ink);
	border-color: var(--accent-ink);
	color: #fff;
}
.btn.wait {
	background: var(--wait);
	border-color: var(--wait);
	color: #fff;
}
.btn.wait:hover:not(:disabled) {
	background: var(--wait-ink);
}
.btn.ghost {
	background: transparent;
	border-color: transparent;
	color: var(--ink-2);
}
.btn.ghost:hover:not(:disabled) {
	background: var(--sunk);
	border-color: transparent;
	color: var(--ink);
}
.btn.small {
	height: 32px;
	padding: 0 12px;
	font-size: 13.5px;
}
.btn.lg {
	height: 50px;
	padding: 0 24px;
	font-size: 15.5px;
	border-radius: 8px;
}
.btn:disabled {
	opacity: 0.55;
	cursor: default;
}
.link-btn {
	padding: 0;
	border: 0;
	background: none;
	color: var(--accent-ink);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-color: rgba(143, 89, 68, 0.3);
	text-underline-offset: 3px;
}
.link-btn:hover {
	color: var(--accent);
	text-decoration-color: currentColor;
}

input[type="text"],
textarea,
select {
	width: 100%;
	border: 1px solid var(--rule-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	transition: border-color 0.12s, box-shadow 0.12s;
}
input[type="text"] {
	height: 40px;
	padding: 0 12px;
}
textarea {
	padding: 10px 12px;
	resize: vertical;
	line-height: 1.5;
}
input[type="text"]:focus,
textarea:focus,
select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(143, 89, 68, 0.16);
}
input::placeholder,
textarea::placeholder {
	color: var(--ink-4);
}
input.invalid {
	border-color: var(--signal) !important;
	box-shadow: 0 0 0 3px rgba(168, 50, 31, 0.12) !important;
}

/* status pills: always a dot and a word, never color alone */
.stat {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 9px 2px 8px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
	color: var(--ink-2);
	background: var(--sunk);
}
.stat i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}
.stat.zvanicno {
	color: var(--slate);
	background: var(--slate-tint);
}
.stat.potvrdjeno {
	color: var(--ok-ink);
	background: var(--ok-tint);
}
.stat.nepotvrdjeno {
	color: var(--wait-ink);
	background: var(--wait-tint);
}
.stat.nepotvrdjeno i {
	background: transparent;
	box-shadow: inset 0 0 0 1.6px currentColor;
}
.stat.demantovano {
	color: var(--signal-ink);
	background: var(--signal-tint);
}
.stat.demantovano i {
	border-radius: 1px;
	transform: rotate(45deg);
}
.stat.idle {
	color: var(--ink-3);
}
.stat.running {
	color: var(--accent-ink);
	background: var(--accent-tint);
}
.stat.running i {
	animation: breathe 1.6s ease-in-out infinite;
}
.stat.finalizing {
	color: var(--wait-ink);
	background: var(--wait-tint);
}
.stat.done {
	color: var(--ok-ink);
	background: var(--ok-tint);
}
.stat.error {
	color: var(--signal-ink);
	background: var(--signal-tint);
}

.notice-host:empty {
	display: none;
}
.notice-host.top {
	padding: 10px 24px 0;
}
.notice-host.top .notice {
	max-width: 1160px;
	margin: 0 auto;
}
.notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 11px 14px;
	border: 1px solid #e8c6bb;
	border-left: 3px solid var(--signal);
	border-radius: var(--radius-sm);
	background: #fbf0ec;
	color: var(--ink);
	font-size: 14px;
	animation: fadein 0.15s ease-out;
}
.notice.info {
	border-color: var(--rule-strong);
	border-left-color: var(--slate);
	background: var(--surface);
}
.notice .n-text {
	flex: 1;
	min-width: 0;
}
.notice .n-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}
.notice .n-close {
	color: var(--ink-3);
}
.task .notice {
	margin-top: 8px;
}
.lead .notice-host {
	margin-top: 8px;
}

/* agent avatars: two letters on an earth-tone tint per role */
.av {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	font: 700 11px/1 var(--sans);
	letter-spacing: 0.02em;
	background: var(--sunk);
	color: var(--ink-2);
}
.av svg {
	width: 62%;
	height: 62%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.av[data-g="kadrovik"] { background: #e3eaee; color: #36515f; }
.av[data-g="nabavke"] { background: #f3ead6; color: #7a5d1f; }
.av[data-g="revizor"] { background: #e7ead9; color: #4b5530; }
.av[data-g="mediji"] { background: #f4e5dd; color: #7d4a36; }
.av[data-g="urednik"] { background: #1f2528; color: #f4f1ea; }
.av[data-g="firme"] { background: #e0ebe8; color: #2f5a52; }
.av[data-g="imovina"] { background: #efe3ea; color: #6a4659; }
.av[data-g="provera"] { background: #f1dfda; color: #803b2d; }
.av[data-g="trijaza"] { background: #ece5d7; color: #5d4f34; }
.av[data-g="novinar"] { background: var(--accent); color: #fff; }
.av[data-g="sistem"] { background: var(--sunk); color: var(--ink-3); }

#main.view-in {
	animation: viewIn 0.36s cubic-bezier(0.2, 0.75, 0.2, 1);
}
@keyframes viewIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
}
@keyframes fadein {
	from { opacity: 0; transform: translateY(2px); }
	to { opacity: 1; transform: none; }
}
@keyframes hlfade {
	0%, 35% { background-color: var(--highlight); }
	100% { background-color: var(--surface); }
}
@keyframes breathe {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.35; }
}
.enter {
	animation: fadein 0.18s ease-out;
}

/* ─── app frame ─────────────────────────────────────────────────────────── */

#app {
	height: 100%;
	display: flex;
	flex-direction: column;
}
.topbar {
	flex: none;
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 28px;
	height: 70px;
	padding: 0 28px;
	background: rgba(255, 254, 251, 0.94);
	backdrop-filter: saturate(1.2) blur(6px);
	border-bottom: 1px solid var(--rule);
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 4px 6px 4px 2px;
	border: 0;
	background: none;
	cursor: pointer;
	border-radius: 6px;
}
.brand-mark {
	width: 32px;
	height: 32px;
}
.wordmark {
	font: 700 25px/1 var(--display);
	letter-spacing: -0.01em;
}
.nav-tabs {
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 6px;
	height: 100%;
}
.nav-tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 0 18px;
	border: 0;
	background: none;
	color: var(--ink-3);
	font-size: 16px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.2s ease;
}
.nav-tab .lbl-short {
	display: none;
}
.nav-tab:hover {
	color: var(--ink);
}
.nav-tab[aria-pressed="true"],
.nav-tab.active {
	color: var(--ink);
}
/* one underline that slides to the active tab */
.nav-ind {
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 0;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--accent);
	pointer-events: none;
}
.nav-ind.ready {
	transition: transform 0.38s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.38s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.top-steps {
	flex: 1;
	min-width: 0;
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: center;
}
.top-steps .steps {
	flex: none;
}
.top-steps .step-txt b {
	font-size: 13.5px;
	white-space: nowrap;
}
.top-steps .step + .step::before {
	width: 22px;
}
.top-right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 12px;
}
.inbox-btn {
	position: relative;
}
.inbox-btn .badge:empty {
	display: none;
}
.inbox-btn .badge {
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--wait);
	color: #fff;
	font-size: 11.5px;
	line-height: 19px;
	text-align: center;
}
.inbox-btn.has-open {
	color: var(--wait-ink);
}
.lang-switch {
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--rule-strong);
	border-radius: 7px;
	background: var(--surface);
}
.lang-btn {
	min-width: 34px;
	height: 28px;
	padding: 0 7px;
	border: 0;
	border-radius: 5px;
	background: none;
	color: var(--ink-3);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
}
.lang-btn[aria-pressed="true"] {
	background: var(--ink);
	color: #fbf8f2;
}
/* the guide: how Dosije works and how to read a dossier */
.help-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--rule-strong);
	border-radius: 50%;
	background: var(--surface);
	color: var(--ink-2);
	font: 700 17px/1 var(--display);
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.help-btn:hover,
.help-btn[aria-expanded="true"] {
	border-color: var(--accent);
	background: var(--accent-tint);
	color: var(--accent-ink);
}

/* run bar: the phases of the run and its counters */
.runbar {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	min-height: 48px;
	padding: 6px 24px;
	background: var(--surface);
	border-bottom: 1px solid var(--rule);
}
.steps {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}
.step {
	display: flex;
	align-items: center;
	gap: 6px;
}
.step + .step::before {
	content: "";
	width: 28px;
	height: 1px;
	margin-right: 4px;
	background: var(--rule-strong);
}
.step.is-done + .step::before {
	background: var(--ok);
}
.step-btn {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 4px 8px 4px 4px;
	border: 0;
	border-radius: 8px;
	background: none;
	text-align: left;
}
button.step-btn {
	cursor: pointer;
}
button.step-btn:hover {
	background: var(--hover);
}
.step-n {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1.5px solid var(--rule-strong);
	color: var(--ink-3);
	font: 700 12.5px/1 var(--sans);
}
.step-n svg {
	width: 14px;
	height: 14px;
}
.step-txt {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
.step-txt b {
	font-size: 14px;
	font-weight: 600;
	color: var(--ink-3);
}
.step-txt small {
	font-size: 12.5px;
	color: var(--ink-3);
	font-variant-numeric: tabular-nums;
}
.step.is-active .step-n {
	border-color: var(--accent);
	background: var(--accent);
	color: #fff;
}
.step.is-active .step-txt b,
.step.is-wait .step-txt b,
.step.is-done .step-txt b {
	color: var(--ink);
}
.step.is-wait .step-n {
	border-color: var(--wait);
	background: var(--wait);
	color: #fff;
}
.step.is-done .step-n {
	border-color: var(--ok);
	background: var(--ok);
	color: #fff;
}
main {
	flex: 1;
	min-height: 0;
	position: relative;
}
body[data-view="hero"] #board,
body[data-view="case"] #hero {
	display: none;
}
.board {
	height: 100%;
	display: grid;
	grid-template-columns: minmax(440px, 38%) minmax(0, 1fr);
	gap: 0;
}
.col {
	min-height: 0;
	min-width: 0;
}
/* DOM order is dossier first (tab order: top bar, dossier, team); the grid keeps the team on the left */
.team {
	grid-column: 1;
	grid-row: 1;
}
.doc {
	grid-column: 2;
	grid-row: 1;
}
/* one column only (see the 1020px block): the switch between the dossier and the team (js/panes.js) */
.pane-switch {
	display: none;
}
@keyframes ps-pulse {
	50% {
		opacity: 0.35;
	}
}

/* ─── start screen ──────────────────────────────────────────────────────── */

.hero {
	height: 100%;
	overflow-y: auto;
	background: var(--paper);
}
.hero-stage {
	position: relative;
	min-height: min(780px, calc(100vh - 60px));
	display: flex;
	align-items: center;
	background: var(--paper) url("img/desk.webp") right center / cover no-repeat;
	border-bottom: 1px solid var(--rule);
}
/* the desk stays on the right; the left half is clean paper for the headline and the form */
.hero-stage::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(244, 241, 234, 0.97) 0%, rgba(244, 241, 234, 0.94) 44%, rgba(244, 241, 234, 0.55) 64%, rgba(244, 241, 234, 0.05) 82%);
	pointer-events: none;
}
.hero-inner {
	position: relative;
	z-index: 1;
	width: 100%;
	padding: 56px var(--page-gutter) 64px;
}
.hero-main {
	max-width: 780px;
}
.hero-title {
	font: 600 54px/1.06 var(--display);
	letter-spacing: -0.02em;
	color: var(--ink);
}
.hero-title em {
	display: block;
	font-style: italic;
	font-weight: 500;
	color: var(--accent-ink);
}
.hero-lede {
	margin-top: 20px;
	max-width: 700px;
	font-size: 17.5px;
	line-height: 1.6;
	color: var(--ink-2);
}
.resume {
	margin-top: 22px;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	border: 1px solid var(--rule-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	box-shadow: var(--shadow-xs);
	font-size: 14px;
}
.resume .stat {
	flex: none;
}
.resume-text {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}
.start-form {
	margin-top: 26px;
	padding: 20px 20px 16px;
	background: var(--surface);
	border: 1px solid var(--rule-strong);
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
}
.start-label {
	display: block;
	margin-bottom: 9px;
	font: 600 17px/1.3 var(--display);
	color: var(--ink);
}
.start-label.sm {
	margin-bottom: 6px;
	font: 600 14px/1.3 var(--sans);
}
.start-row {
	position: relative;
	display: flex;
	gap: 10px;
}
.start-icon {
	position: absolute;
	left: 15px;
	top: 50%;
	width: 19px;
	height: 19px;
	transform: translateY(-50%);
	color: var(--ink-3);
	pointer-events: none;
}
.start-row input[type="text"] {
	flex: 1;
	min-width: 0;
	height: 50px;
	padding-left: 44px;
	font-size: 16.5px;
	border-radius: 8px;
}
.start-hint {
	margin-top: 8px;
	font-size: 13.5px;
	color: var(--ink-3);
}
.start-extra {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed var(--rule);
}
.focus-toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 8px 4px 2px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--accent-ink);
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
}
.focus-toggle:hover span:not(.opt) {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.focus-toggle .chev {
	width: 15px;
	height: 15px;
	transition: transform 0.25s ease;
}
.focus-toggle[aria-expanded="true"] .chev {
	transform: rotate(90deg);
}
.focus-toggle .opt {
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--sunk);
	color: var(--ink-3);
	font-size: 12px;
	font-weight: 600;
}
/* opens and closes by its height, so the form below moves smoothly */
.focus-box {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition: grid-template-rows 0.28s ease, opacity 0.2s ease;
}
.focus-box[data-open="true"] {
	grid-template-rows: 1fr;
	opacity: 1;
}
.focus-inner {
	min-height: 0;
	overflow: hidden;
}
.focus-box[data-open="true"] .focus-inner {
	padding-top: 10px;
}
.examples {
	margin-top: 30px;
}
.examples-title {
	margin-bottom: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink-2);
}
.example-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}
.example {
	position: relative;
	display: grid;
	grid-template-rows: auto 1fr auto;
	gap: 4px;
	padding: 14px 16px 12px;
	border: 1px solid var(--rule);
	border-left: 3px solid var(--accent);
	border-radius: 8px;
	background: rgba(255, 254, 251, 0.94);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.example:hover {
	border-color: var(--rule-strong);
	border-left-color: var(--accent-ink);
	box-shadow: var(--shadow);
	transform: translateY(-1px);
}
.ex-kind {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--ink-3);
}
.ex-name {
	font: 600 17px/1.25 var(--display);
	color: var(--ink);
}
.ex-go {
	margin-top: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--accent-ink);
}
.example:hover .ex-go {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* below the desk: where the data comes from (the guide lives in the "?" dialog) */
.hero-sheet {
	max-width: 1240px;
	margin: 0 auto;
	padding: 8px 40px 48px;
}
.hero-sheet > section {
	padding: 40px 0;
	border-bottom: 1px solid var(--rule);
}
.sheet-title {
	margin-bottom: 22px;
	font: 600 26px/1.2 var(--display);
	letter-spacing: -0.01em;
}
.sheet-title.sm {
	margin-bottom: 6px;
	font-size: 21px;
}
.how-steps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	counter-reset: none;
}
.how-steps li {
	position: relative;
	padding: 4px 28px 4px 0;
}
.how-steps li + li {
	padding-left: 28px;
	border-left: 1px solid var(--rule);
}
.how-icon {
	display: inline-flex;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: var(--accent-tint);
	color: var(--accent-ink);
}
.how-icon svg {
	width: 26px;
	height: 26px;
}
.how-n {
	position: absolute;
	top: 4px;
	right: 28px;
	font: 600 40px/1 var(--display);
	color: var(--rule-strong);
}
.how-steps li:last-child .how-n {
	right: 0;
}
.how-steps h4 {
	margin: 16px 0 6px;
	font: 600 19px/1.3 var(--display);
}
.how-steps p {
	font-size: 15px;
	color: var(--ink-2);
}
.gloss-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px 32px;
}
.gloss-grid dt {
	margin-bottom: 6px;
	font-weight: 700;
	font-size: 15px;
}
.gloss-grid dd {
	font-size: 14.5px;
	color: var(--ink-2);
}
.sig-word {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--signal-ink);
}
.sig-word::before {
	content: "";
	width: 3px;
	height: 15px;
	background: var(--signal);
}
/* the heading gets room above the strip: it sits on the same left line as the headline of the page */
.sources.band {
	padding: 72px 0 60px;
	border-bottom: 1px solid var(--rule);
}
.sources.band .src-head {
	padding: 0 var(--page-gutter);
	margin-bottom: 30px;
}
.sources.band .sheet-title {
	font-size: 34px;
	line-height: 1.15;
}
.src-head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin-bottom: 18px;
}
.src-head .sheet-title {
	margin-bottom: 0;
}
.src-marquee {
	overflow: hidden;
	padding: 6px 0 10px;
}
.src-track {
	display: flex;
	gap: 14px;
	width: max-content;
	animation: srcScroll 70s linear infinite;
}
.src-marquee:hover .src-track,
.src-marquee:focus-within .src-track,
.src-track.paused {
	animation-play-state: paused;
}
/* the list is there twice: moving by half of it (and half a gap) lands on the same picture */
@keyframes srcScroll {
	to {
		transform: translateX(calc(-50% - 7px));
	}
}
.src-card {
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 262px;
	min-height: 128px;
	padding: 16px 18px;
	border: 1px solid var(--rule);
	border-top: 3px solid var(--wait);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.src-card.official {
	border-top-color: var(--slate);
}
.src-kind {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--wait-ink, #7d4d0c);
}
.src-card.official .src-kind {
	color: var(--slate);
}
.src-card b {
	font: 600 19px/1.25 var(--display);
	color: var(--ink);
}
.src-desc {
	font-size: 14.5px;
	color: var(--ink-2);
}

/* ─── try it yourself: the QR code of the public address ─────────────────── */

.try.band {
	padding: 72px var(--page-gutter) 80px;
	border-bottom: 1px solid var(--rule);
}
.try-inner {
	display: grid;
	grid-template-columns: minmax(0, 580px) auto;
	justify-content: start;
	align-items: center;
	column-gap: clamp(48px, 9vw, 140px);
}
.try-kicker {
	margin: 0 0 10px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}
.try .sheet-title {
	margin-bottom: 14px;
	font-size: 34px;
	line-height: 1.15;
}
.try-lede {
	max-width: 54ch;
	margin: 0 0 26px;
	font-size: 16.5px;
	line-height: 1.6;
	color: var(--ink-2);
}
.try-steps {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.try-steps li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 15.5px;
	color: var(--ink);
}
.try-n {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--rule-strong);
	border-radius: 50%;
	background: var(--surface);
	font: 600 14px/1 var(--display);
	color: var(--accent-ink);
}
/* the code lies on the desk like one more paper, taped among the others */
.try-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: 24px 24px 12px;
	border: 1px solid var(--rule);
	border-top: 3px solid var(--accent);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-lg);
	transform: rotate(-1.5deg);
}
.try-card::before {
	content: "";
	position: absolute;
	top: -15px;
	left: 50%;
	width: 96px;
	height: 26px;
	border-radius: 2px;
	background: rgba(181, 102, 74, 0.22);
	transform: translateX(-50%) rotate(3deg);
}
.try-qr {
	display: block;
	width: 232px;
	height: 232px;
	color: var(--ink);
}
.try-url {
	margin: 10px 0 2px;
	font: 600 15.5px/1.3 var(--mono);
	letter-spacing: 0.02em;
	color: var(--ink);
}
.try-share {
	margin-top: 4px;
	color: var(--accent-ink);
}
.try-share svg {
	width: 15px;
	height: 15px;
}
.hero-note {
	padding-top: 28px;
	text-align: center;
	font: italic 500 16px/1.5 var(--display);
	color: var(--ink-3);
}

/* ─── left column: the agent team ───────────────────────────────────────── */

.team {
	display: flex;
	flex-direction: column;
	gap: 14px;
	overflow-y: auto;
	padding: 18px 16px 20px 20px;
	border-right: 1px solid var(--rule);
	background: #f7f4ee;
}
.team-card {
	flex: 0 1 auto;
	display: flex;
	flex-direction: column;
	padding: 0 18px 10px;
}
.col-head {
	flex: none;
	padding: 16px 0 2px;
}
.col-head-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.col-title {
	font: 600 20px/1.2 var(--display);
}
.conc-label {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin-top: 10px;
}
.conc-n {
	font: 600 40px/1 var(--display);
	font-variant-numeric: tabular-nums;
	color: var(--ink);
}
.conc-n.is-live {
	color: var(--accent-ink);
}
.conc-text {
	font-size: 15.5px;
	font-weight: 600;
	color: var(--ink-2);
}
.conc-peak {
	flex-basis: 100%;
	font-size: 13px;
	color: var(--ink-3);
}
.hold {
	margin-top: 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px 12px;
	border: 1px solid #ecd4a8;
	border-radius: var(--radius-sm);
	background: var(--wait-tint);
	font-size: 13.5px;
}
.conc {
	margin-top: 14px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--rule);
}
.spark {
	height: 92px;
}
.spark-svg {
	display: block;
	overflow: visible;
}
.spark-grid {
	stroke: var(--rule);
	stroke-width: 1;
	fill: none;
	stroke-dasharray: 2 3;
}
.spark-area {
	fill: rgba(143, 89, 68, 0.12);
}
.spark-line {
	stroke: var(--accent);
	stroke-width: 1.6;
	fill: none;
}
.spark-max {
	font: 10.5px var(--mono);
	fill: var(--ink-3);
}
.timeline-key ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 32px;
}
.timeline-key li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14.5px;
	color: var(--ink-2);
	line-height: 1.4;
}
.timeline-key li b {
	color: var(--ink);
	font-weight: 600;
}
.key-tip {
	margin-top: 14px;
	font-size: 14px;
	color: var(--ink-3);
}
.sw {
	flex: none;
	display: inline-block;
	margin-top: 4px;
	width: 18px;
	height: 8px;
	border-radius: 2px;
}
.sw.inf {
	background: var(--think);
}
.sw.tool {
	background: var(--accent);
}
.sw.wait {
	background: repeating-linear-gradient(-45deg, var(--wait) 0 2px, var(--wait-tint) 2px 5px);
}
.sw.tick {
	width: 2px;
	height: 13px;
	margin: 1px 8px 0;
	border-radius: 0;
	background: var(--ink);
}
.sw.spawn {
	width: 10px;
	height: 10px;
	margin: 3px 4px 0;
	border-radius: 50%;
	border: 1.5px solid var(--ink-2);
	background: var(--surface);
}

.gantt-wrap {
	position: relative;
	flex: 0 1 auto;
	min-height: 340px;
	display: flex;
	flex-direction: column;
	margin-top: 12px;
}
/* during a map there are no case lanes: no reserved height */
.gantt-wrap.is-mapa {
	min-height: 0;
}
.gantt-wrap.is-mapa .lanes-dyn {
	min-height: 96px;
}
#gantt {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 2;
}
.ruler-gap {
	flex: none;
	height: 22px;
}
.lanes-core {
	flex: none;
}
.dyn-wrap {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
.lanes-dyn {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}
.dyn-empty {
	padding: 14px 0;
	font-size: 13.5px;
	color: var(--ink-3);
}

.lane {
	padding: 10px 8px 6px;
	margin: 0 -8px;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.12s;
}
.lane:hover {
	background: var(--hover);
}
.lane.selected {
	background: var(--accent-tint);
}
.lane.dim {
	opacity: 0.55;
}
.lane-top {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 32px;
}
.adot {
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: transparent;
}
.lane[data-state="tool"] .adot,
.lane[data-state="think"] .adot,
.lane[data-state="work"] .adot {
	background: var(--accent);
	animation: breathe 1.6s ease-in-out infinite;
}
.lane-id {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
.lane-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.lane-role {
	font-size: 13px;
	color: var(--ink-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.lane-spawn:empty {
	display: none;
}
.lane-spawn {
	flex: none;
	max-width: 42%;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--accent-tint);
	color: var(--accent-ink);
	font-size: 11.5px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	animation: fadein 0.2s ease-out;
}
.lane-status {
	flex: none;
	max-width: 52%;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: var(--ink-3);
	background: var(--sunk);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.lane-status.think,
.lane-status.work {
	color: var(--ink-2);
}
.lane-status.tool {
	color: var(--accent-ink);
	background: var(--accent-tint);
}
.lane-status.wait {
	color: #fff;
	background: var(--wait);
}
.lane-status.done {
	color: var(--ok-ink);
	background: var(--ok-tint);
}
.lane-status.blocked,
.lane-status.error {
	color: var(--signal-ink);
	background: var(--signal-tint);
}
.lane-track {
	height: 26px;
}
.lane.is-dyn .lane-top {
	padding-left: 8px;
}
.lane.is-dyn .av {
	width: 26px;
	height: 26px;
	font-size: 10px;
}
.lane-group {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 12px 0 4px;
	padding: 6px 0;
	border: 0;
	border-top: 1px solid var(--rule);
	background: none;
	text-align: left;
	cursor: pointer;
	color: var(--ink-2);
}
.lane-group:hover {
	color: var(--ink);
}
.lane-group .g-chev {
	flex: none;
	width: 14px;
	color: var(--ink-3);
	transition: transform 0.15s;
}
.lane-group[aria-expanded="false"] .g-chev {
	transform: rotate(-90deg);
}
.lane-group .g-label {
	font-size: 13.5px;
	font-weight: 700;
}
.lane-group .g-count {
	min-width: 20px;
	height: 19px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--sunk);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 19px;
	text-align: center;
}
.lane-group .g-desc {
	flex: 1;
	min-width: 0;
	font-size: 12.5px;
	color: var(--ink-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* live source search: who searched which source, for what, and what came back */
.live {
	flex: none;
	display: flex;
	flex-direction: column;
	min-height: 240px;
	max-height: 46vh;
}
.live-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 18px 8px;
}
.live-filter {
	font-size: 13px;
	color: var(--ink-3);
}
.live-count {
	margin-left: auto;
	font-size: 13px;
	color: var(--ink-3);
	font-variant-numeric: tabular-nums;
}
.live-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 0 10px 10px;
}
.srow {
	display: grid;
	grid-template-columns: 44px 24px minmax(0, 1fr) auto;
	align-items: start;
	gap: 9px;
	padding: 8px;
	border-top: 1px solid var(--rule);
	font-size: 13.5px;
}
.srow:first-child {
	border-top: 0;
}
.srow .av {
	width: 24px;
	height: 24px;
	font-size: 9.5px;
}
.srow .rt {
	padding-top: 3px;
	font: 12px var(--mono);
	color: var(--ink-3);
}
.srow .rx {
	min-width: 0;
	line-height: 1.4;
}
.srow .r-who {
	display: block;
	color: var(--ink-2);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.srow .r-who b {
	color: var(--ink);
	font-weight: 600;
}
.srow .rsrc {
	color: var(--accent-ink);
	font-weight: 600;
}
.srow .act {
	color: var(--ink-3);
}
.srow .lbl {
	color: var(--ink);
	overflow-wrap: anywhere;
}
.srow a.lbl {
	text-decoration: none;
}
.srow a.lbl:hover {
	text-decoration: underline;
}
.srow .rs {
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	background: var(--sunk);
	color: var(--ink-2);
}
.srow .rs.ok {
	background: var(--ok-tint);
	color: var(--ok-ink);
}
.srow .rs.cache {
	background: var(--slate-tint);
	color: var(--slate);
}
.srow .rs.pending {
	background: var(--accent-tint);
	color: var(--accent-ink);
}
.srow .rs.err {
	background: var(--signal-tint);
	color: var(--signal-ink);
}
.srow .rs.interrupted {
	color: var(--ink-3);
}
.srow.prekinuto .rx {
	color: var(--ink-3);
}
.srow.u_toku .lbl {
	color: var(--ink-2);
}

/* ─── right column: the dossier ─────────────────────────────────────────── */

.doc {
	display: flex;
	flex-direction: column;
}
.doc-scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 22px 28px 48px;
}
.doc-scroll > * {
	width: 100%;
	max-width: 920px;
	margin-left: auto;
	margin-right: auto;
	flex: none;
}
.doc-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 6px 0 14px;
	border-bottom: 2px solid var(--ink);
}
.doc-title {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.doc-actions {
	flex: none;
	display: flex;
	gap: 8px;
	padding-top: 22px;
}
.inst-legal {
	font-size: 14px;
	color: var(--ink-2);
}
.meta-line {
	font: 13px var(--mono);
	color: var(--ink-3);
	overflow-wrap: anywhere;
}
.meta-sub {
	font-size: 14px;
	color: var(--ink-2);
}
.meta-sub b {
	color: var(--ink);
}

.dock {
	border: 1px solid #ecd4a8;
	border-radius: var(--radius);
	background: #fdf8ee;
	overflow: hidden;
}
.dock-head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 12px;
	padding: 14px 18px 8px;
}
.dock-pulse {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wait);
	align-self: center;
}
.dock-title {
	font: 600 18px/1.3 var(--display);
}
.dock-sub {
	font-size: 13px;
	color: var(--wait-ink);
}
.dock-list {
	padding: 0 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.task {
	border: 1px solid var(--rule);
	border-radius: var(--radius-sm);
	background: var(--surface);
	animation: fadein 0.15s ease-out;
}
.task.sending {
	opacity: 0.6;
}
.task-head {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
}
.task-head .kind {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--wait-tint);
	color: var(--wait-ink);
	font-size: 12px;
	font-weight: 600;
}
.task-time {
	margin-left: auto;
	font: 12px var(--mono);
	color: var(--ink-3);
}
.task-chev {
	width: 12px;
	color: var(--ink-3);
}
.task-chev::before {
	content: "+";
}
.task.expanded .task-chev::before {
	content: "−";
}
.task-title {
	padding: 0 14px 6px;
	font-size: 16px;
	font-weight: 600;
}
.task:not(.expanded) .task-title {
	padding-bottom: 10px;
}
.task:not(.expanded) .task-body {
	display: none;
}
.task-body {
	padding: 0 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.hold-line {
	padding: 8px 10px;
	border-radius: 6px;
	background: var(--wait-tint);
	color: var(--wait-ink);
	font-size: 13.5px;
}
.hold-line b {
	font-weight: 600;
}
.task .draft.finding {
	border: 1px solid var(--rule);
	border-radius: var(--radius-sm);
	background: var(--hover);
}
.task .draft.finding::before {
	border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.task-q {
	font-size: 14.5px;
}
.task-hint {
	font-size: 13.5px;
	color: var(--ink-3);
}
.task-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 13.5px;
}
.task-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.task-answer textarea {
	min-height: 64px;
}
.task-kbd {
	margin-left: auto;
	font: 12px var(--mono);
	color: var(--ink-3);
}

.done-card {
	display: flex;
	gap: 16px;
	padding: 20px 22px;
	border: 1px solid #c9dccd;
	border-radius: var(--radius);
	background: linear-gradient(180deg, #f1f6f1, var(--surface));
	animation: fadein 0.25s ease-out;
}
.done-icon {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--ok);
	color: #fff;
}
.done-icon svg {
	width: 22px;
	height: 22px;
}
.done-main {
	flex: 1;
	min-width: 0;
}
.done-title {
	font: 600 21px/1.25 var(--display);
}
.done-text {
	margin-top: 4px;
	font-size: 15px;
	color: var(--ink-2);
}
.done-actions {
	margin-top: 14px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
}

/* main signals: numbered like a front page, each with why, whom, status, source and date */
.signals #signalsBody {
	padding: 4px 22px 18px;
}
.signals .empty-line {
	padding: 8px 0 4px;
}
.lede-box {
	margin: 4px 0 14px;
	padding: 14px 16px;
	border-left: 3px solid var(--accent);
	background: var(--hover);
}
.lede-box .lede {
	font: 17px/1.6 var(--display);
	color: var(--ink);
}
.lede-box .lede.clamp {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.lede-more {
	margin-top: 6px;
	font-size: 13.5px;
}
.sig-list {
	display: flex;
	flex-direction: column;
}
.sig-list > li + li {
	border-top: 1px solid var(--rule);
}
.sig-row {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) auto;
	align-items: start;
	gap: 12px;
	width: 100%;
	padding: 12px 6px;
	border: 0;
	border-radius: 6px;
	background: none;
	text-align: left;
	cursor: pointer;
}
.sig-row:hover {
	background: var(--hover);
}
.sig-n {
	font: 600 22px/1.1 var(--display);
	color: var(--signal);
	font-variant-numeric: tabular-nums;
}
.sig-body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.sig-title {
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--ink);
	overflow-wrap: anywhere;
}
.sig-why {
	font-size: 14px;
	color: var(--ink-2);
	line-height: 1.5;
}
.sig-meta {
	font-size: 12.5px;
	color: var(--ink-3);
}
.sig-meta b {
	color: var(--ink-2);
	font-weight: 600;
}
.sig-row .stat {
	margin-top: 1px;
}
/* a group of signals of one kind: number, title, status and the +/− that opens it, on one line */
.sig-row.group {
	grid-template-columns: 30px minmax(0, 1fr) auto 18px;
}
.sig-chev {
	font-size: 17px;
	line-height: 1.2;
	text-align: center;
	color: var(--ink-3);
}
.sig-sub {
	padding: 0 0 8px 42px;
}
.sig-row.sub {
	grid-template-columns: minmax(0, 1fr) auto;
	padding: 7px 6px;
}
.sig-row.sub .sig-title {
	font-size: 14px;
	font-weight: 500;
}

/* people and companies: who they are and how the record links them to the institution */
.entities {
	padding: 4px 22px 18px;
}
.ent-groups {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 22px;
}
.ent-group h4 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 700;
	color: var(--ink-3);
}
.ent-list {
	display: flex;
	flex-direction: column;
}
.ent {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 8px;
	margin: 0 -8px;
	border: 0;
	border-top: 1px solid var(--rule);
	border-radius: 0;
	background: none;
	text-align: left;
	cursor: pointer;
	animation: fadein 0.18s ease-out;
}
.ent-list li:first-child .ent {
	border-top: 0;
}
.ent:hover {
	background: var(--hover);
}
.ent.active {
	background: var(--accent-tint);
}
.e-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.35;
}
.e-name {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--ink);
	overflow-wrap: anywhere;
}
.e-rel {
	font-size: 12.5px;
	color: var(--ink-3);
	overflow-wrap: anywhere;
}
.e-count {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--ink-2);
	white-space: nowrap;
}
.ent-note {
	margin-top: 10px;
	font-size: 12.5px;
	color: var(--ink-3);
}

/* findings: tabs by area, rows that scan quickly, details on every row */
.findings-card {
	overflow: hidden;
}
.findings-head {
	align-items: center;
	padding-bottom: 4px;
}
.status-help {
	font-size: 13px;
	color: var(--ink-3);
	text-align: right;
}
.status-help summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--accent-ink);
}
.status-help[open] {
	flex-basis: 100%;
	text-align: left;
}
.status-help dl {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 18px;
	margin-top: 10px;
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	background: var(--hover);
}
.status-help dl div {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.status-help dd {
	font-size: 13px;
	color: var(--ink-2);
}
.findings-head:has(.status-help[open]) {
	flex-wrap: wrap;
}
.tabs-bar {
	position: sticky;
	top: 0;
	z-index: 4;
	padding: 6px 22px 0;
	background: var(--surface);
	border-bottom: 1px solid var(--rule);
}
.tabs {
	display: flex;
	gap: 2px;
	overflow-x: auto;
	scrollbar-width: none;
}
.tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 12px 11px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: var(--ink-3);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}
.tab:hover {
	color: var(--ink);
}
.tab.active {
	color: var(--ink);
	border-bottom-color: var(--accent);
}
.tab.active .count {
	background: var(--accent);
	color: #fff;
}
.tab .count {
	height: 19px;
	min-width: 20px;
	font-size: 11.5px;
}
.filter-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 0 10px;
	font-size: 13px;
}
.f-lab {
	color: var(--ink-3);
	font-weight: 600;
}
.fchip {
	padding: 3px 10px;
	border: 1px solid var(--rule-strong);
	border-radius: 999px;
	background: var(--surface);
	font-size: 13px;
	cursor: pointer;
}
.fchip:hover {
	border-color: var(--ink-3);
}
.find-list > .empty-line {
	padding: 22px;
}
.finding {
	position: relative;
	padding: 18px 22px 16px 26px;
	border-top: 1px solid var(--rule);
	background: var(--surface);
}
.find-list .finding:first-child {
	border-top: 0;
}
.finding::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: transparent;
}
.finding.sev-signal::before {
	background: var(--signal);
}
.finding.sev-paznja::before {
	background: var(--wait);
}
.finding.is-new,
.finding.flash {
	animation: fadein 0.18s ease-out, hlfade 1.6s ease-out;
}
.finding.dimmed {
	opacity: 0.45;
}
.f-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 8px;
	margin-bottom: 7px;
}
.f-meta .sect {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--ink-3);
	letter-spacing: 0.02em;
}
.f-meta .sect::after {
	content: "·";
	margin-left: 8px;
	color: var(--rule-strong);
}
.f-meta .code {
	padding: 1px 8px;
	border-radius: 4px;
	font-size: 12.5px;
	font-weight: 600;
	background: var(--sunk);
	color: var(--ink-2);
}
.f-meta .code.signal {
	color: var(--signal-ink);
	background: var(--signal-tint);
}
.f-meta .code.paznja {
	color: var(--wait-ink);
	background: var(--wait-tint);
}
.appr {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--ok-ink);
}
.appr.pending {
	color: var(--wait-ink);
}
.appr.rejected {
	color: var(--signal);
}
.f-title {
	font: 600 18px/1.35 var(--display);
	color: var(--ink);
	overflow-wrap: anywhere;
}
.f-text {
	margin-top: 6px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--ink-2);
	overflow-wrap: anywhere;
}
.note {
	margin-top: 10px;
	padding: 9px 12px;
	border-radius: 6px;
	background: var(--hover);
	font-size: 14px;
	color: var(--ink-2);
}
.note.conflict {
	background: var(--signal-tint);
	color: var(--ink);
}
.note b {
	font-weight: 600;
}
.f-trust {
	margin-top: 10px;
	font-size: 13px;
	color: var(--ink-3);
}
.f-trust b {
	color: var(--ink-2);
	font-weight: 600;
}
.f-sources {
	margin-top: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.src {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 3px 10px;
	border: 1px solid var(--rule);
	border-radius: 6px;
	background: var(--hover);
	color: var(--ink-2);
	font-size: 13px;
	text-decoration: none;
	overflow-wrap: anywhere;
}
.src.official {
	border-color: #c9d3d8;
	background: var(--slate-tint);
	color: var(--slate);
}
.f-sources:not(.list) a.src:hover {
	border-color: var(--accent);
	color: var(--accent-ink);
}
.f-sources.list {
	display: block;
}
.src-count {
	margin-bottom: 4px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--ink-3);
}
.src-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.src-list li {
	font-size: 13.5px;
}
.src-list .sl-meta {
	color: var(--ink-3);
	font-weight: 600;
}
.src-list a.src,
.src-list .src {
	display: inline;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ink-2);
}
.src-list a.src:hover {
	color: var(--accent-ink);
	text-decoration: underline;
}
.src-more {
	margin-top: 4px;
	font-size: 13px;
}
.f-foot {
	margin-top: 10px;
	font-size: 12.5px;
	color: var(--ink-3);
}

/* ─── Mapa prioriteta ───────────────────────────────────────────────────── */

.mapa .doc-scroll > * {
	max-width: 1040px;
}
.mapa-head .lede {
	max-width: 760px;
	margin-top: 4px;
}
.criteria {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}
.crit {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 12px 14px;
	border: 1px solid var(--rule);
	border-top: 3px solid var(--area, var(--ink-3));
	border-radius: var(--radius-sm);
	background: var(--surface);
	font-size: 13px;
	color: var(--ink-3);
}
.crit b {
	font-size: 14px;
	color: var(--ink);
}
[data-area="rukovodstvo"] { --area: #3f5866; }
[data-area="nabavke"] { --area: #9a7a33; }
[data-area="revizija"] { --area: #5f6b3c; }
[data-area="veze"] { --area: #8f5944; }

.mapa-form {
	padding: 18px 20px;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-xs);
}
.mapa-form-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 10px;
}
.form-title {
	font: 600 18px/1.3 var(--display);
}
.form-sub {
	font-size: 13px;
	color: var(--ink-3);
}
.inst-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 14px;
	counter-reset: inst;
}
.inst-row {
	display: flex;
	align-items: center;
	gap: 8px;
}
.inst-n {
	flex: none;
	width: 20px;
	font: 600 15px/1 var(--display);
	color: var(--ink-3);
	text-align: right;
}
.inst-row input[type="text"] {
	flex: 1;
	min-width: 0;
	height: 38px;
}
.inst-x {
	flex: none;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--ink-3);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.inst-x:hover {
	background: var(--sunk);
	color: var(--signal);
}
.inst-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin-top: 12px;
}
.mapa-form textarea {
	margin-top: 10px;
	min-height: 150px;
}
.mapa-form-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--rule);
}
.mapa-progress {
	margin-left: auto;
	font-size: 13.5px;
	color: var(--ink-3);
	font-variant-numeric: tabular-nums;
}
/* after a run the list folds to one line: what was compared, and a way back to edit it */
.mapa-form.compact .inst-list,
.mapa-form.compact .inst-tools,
.mapa-form.compact textarea,
.mapa-form.compact .mapa-form-head .form-sub {
	display: none;
}
.mapa-form.compact .mapa-form-head {
	margin-bottom: 0;
}
.mapa-form.compact .mapa-form-row {
	margin-top: 10px;
	padding-top: 10px;
}
.mapa-summary {
	font-size: 14px;
	color: var(--ink-2);
}
.mapa-veza {
	padding: 12px 16px;
	border: 1px solid #e7cdbf;
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	background: var(--accent-tint);
	font-size: 14px;
	color: var(--ink);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.mapa-table {
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	overflow: hidden;
	box-shadow: var(--shadow-xs);
}
.mhead,
.mrow-main {
	display: grid;
	grid-template-columns: 46px minmax(0, 1.6fr) minmax(180px, 1.1fr) minmax(0, 1.4fr) 104px 74px;
	align-items: center;
	gap: 14px;
	padding: 0 18px;
}
.mhead {
	height: 40px;
	border-bottom: 1px solid var(--rule);
	background: var(--hover);
	font-size: 12.5px;
	font-weight: 700;
	color: var(--ink-3);
}
.mrows > .empty-line {
	padding: 26px 22px;
	text-align: center;
}
.mrow {
	border-top: 1px solid var(--rule);
	animation: fadein 0.18s ease-out;
}
.mrow:first-child {
	border-top: 0;
}
.mrow-main {
	min-height: 70px;
	padding-top: 12px;
	padding-bottom: 12px;
	cursor: pointer;
}
.mrow-main:hover {
	background: var(--hover);
}
.mrow.open .mrow-main {
	background: var(--hover);
}
.rk {
	font: 600 28px/1 var(--display);
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}
.rk.prov {
	color: var(--ink-4);
}
.mrow[data-status="error"] .rk {
	color: var(--rule-strong);
}
.mname {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.mn {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
}
.ms {
	font-size: 12.5px;
	color: var(--ink-3);
	overflow-wrap: anywhere;
}
.mscore {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.mscore .num {
	font: 600 20px/1 var(--sans);
	font-variant-numeric: tabular-nums;
}
.mscore .num small {
	margin-left: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--ink-3);
}
.bar {
	display: flex;
	height: 8px;
	border-radius: 999px;
	background: var(--sunk);
	overflow: hidden;
}
.bar i {
	display: block;
	height: 100%;
	background: var(--area, var(--accent));
	transition: width 0.3s ease-out;
}
.mchips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	min-width: 0;
}
.chip {
	max-width: 100%;
	padding: 2px 8px;
	border-radius: 5px;
	font-size: 12.5px;
	font-weight: 600;
	background: var(--sunk);
	color: var(--ink-2);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.chip.signal {
	background: var(--signal-tint);
	color: var(--signal-ink);
}
.chip.paznja {
	background: var(--wait-tint);
	color: var(--wait-ink);
}
.mtoggle {
	justify-self: end;
	font-size: 13.5px;
}
.mdetail {
	padding: 4px 18px 18px 78px;
	background: var(--hover);
}
.m-err {
	padding: 10px 12px;
	border-radius: 6px;
	background: var(--signal-tint);
	color: var(--signal-ink);
	font-size: 14px;
}
.m-sum {
	font-size: 15px;
	line-height: 1.6;
	color: var(--ink);
	margin-bottom: 10px;
}
.m-none {
	font-size: 14px;
	color: var(--ink-3);
}
.m-areas {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 22px;
	margin: 4px 0 12px;
}
.m-area h5 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 700;
	color: var(--ink-2);
}
.m-area h5::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 2px;
	background: var(--area);
}
.m-area h5 span {
	margin-left: auto;
	font-variant-numeric: tabular-nums;
	color: var(--ink);
}
.m-reasons {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13.5px;
	color: var(--ink-2);
}
.m-reasons li::before {
	content: "– ";
	color: var(--ink-4);
}
.m-actions {
	margin-top: 14px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
}
.m-resolved {
	font-size: 13px;
	color: var(--ink-3);
}
.mrow[data-status="queued"] .mn,
.mrow[data-status="queued"] .num {
	color: var(--ink-3);
}
/* ─── Sanduče (side panel) ──────────────────────────────────────────────── */

.backdrop {
	position: fixed;
	inset: 0;
	z-index: 40;
	background: rgba(17, 24, 39, 0.22);
	display: none;
}
.backdrop.open {
	display: block;
}
.inbox {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	width: min(440px, 100vw);
	display: none;
	flex-direction: column;
	background: var(--surface);
	border-left: 1px solid var(--rule);
	box-shadow: var(--shadow-lg);
}
.inbox.open {
	display: flex;
}
.inbox-head {
	flex: none;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 22px 16px;
	border-bottom: 1px solid var(--rule);
}
.inbox-sub {
	margin-top: 3px;
	font-size: 13px;
	color: var(--ink-3);
}
.inbox-scroll {
	flex: 1;
	overflow-y: auto;
}
.inbox-open {
	padding: 18px 22px 14px;
	border-bottom: 1px solid var(--rule);
}
.task-list {
	margin-top: 8px;
}
.open-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-top: 1px solid var(--rule);
}
.or-main {
	flex: 1;
	min-width: 0;
}
.or-title {
	font-size: 14px;
	line-height: 1.35;
}
.or-sub {
	font-size: 12px;
	color: var(--ink-3);
}
.open-row.blocking .or-sub {
	color: var(--wait-ink);
}
.inbox-empty {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 6px 0 2px;
	font-size: 13.5px;
	color: var(--ink-2);
}
.history {
	padding: 16px 22px 10px;
}
.hist {
	padding: 8px 0;
	border-top: 1px solid var(--rule);
}
.hist:first-child {
	margin-top: 8px;
}
.h-title {
	font-size: 13.5px;
}
.h-sub {
	font-size: 12px;
	color: var(--ink-3);
}
.hist.no .h-sub {
	color: var(--signal);
}
.lead {
	padding: 18px 22px 22px;
	border-bottom: 1px solid var(--rule);
}
.lead p {
	margin: 6px 0 10px;
	font-size: 13.5px;
	color: var(--ink-2);
}
.lead form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-start;
}
.lead input[type="text"] {
	width: 100%;
}
.seg {
	display: flex;
	gap: 18px;
	font-size: 14px;
}
.seg label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}
.seg input {
	accent-color: var(--accent);
	margin: 0;
}

/* ─── toasts, tooltip ───────────────────────────────────────────────────── */

.toasts {
	position: fixed;
	right: 20px;
	bottom: 56px;
	z-index: 60;
	width: min(340px, calc(100vw - 40px));
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.toast {
	display: flex;
	gap: 10px;
	padding: 12px 12px 12px 14px;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
	animation: fadein 0.15s ease-out;
}
.toast.ask,
.toast.approve {
	border-color: #fcd9a8;
	box-shadow: inset 3px 0 0 var(--wait), var(--shadow-lg);
}
.toast.error .t-title {
	color: var(--signal);
}
.t-main {
	flex: 1;
	min-width: 0;
}
.t-title {
	font-size: 13.5px;
	font-weight: 650;
}
.t-text {
	margin-top: 1px;
	font-size: 13px;
	color: var(--ink-2);
}
.t-actions {
	margin-top: 6px;
	display: flex;
	gap: 14px;
}
.t-x {
	flex: none;
	align-self: flex-start;
	background: none;
	border: 0;
	padding: 0 2px;
	font-size: 18px;
	line-height: 1;
	color: var(--ink-3);
	cursor: pointer;
}
.tip {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 80;
	max-width: 340px;
	padding: 7px 10px;
	background: var(--ink);
	color: #fff;
	border-radius: 8px;
	box-shadow: var(--shadow-lg);
	font-size: 12px;
	pointer-events: none;
	opacity: 0;
	white-space: pre-line;
	word-break: break-word;
}
.tip.show {
	opacity: 1;
}
.tip-title {
	font-weight: 650;
}
.tip-sub {
	color: #cbd5e1;
	margin-top: 1px;
}

/* ─── bottom drawer: raw Mozaik events ──────────────────────────────────── */

.drawer {
	flex: none;
	background: var(--surface);
	border-top: 1px solid var(--rule);
}
.drawer-toggle {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	height: 36px;
	padding: 0 24px;
	background: none;
	border: 0;
	font-size: 12.5px;
	color: var(--ink-2);
	text-align: left;
	cursor: pointer;
}
.drawer-toggle:hover {
	background: var(--hover);
}
.d-line {
	flex: 1;
	min-width: 0;
	color: var(--ink-2);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.d-hint {
	flex: none;
	color: var(--accent);
	font-weight: 550;
}
.ev-rate {
	margin-left: auto;
	font: 11.5px var(--mono);
	color: var(--ink-3);
}
.ev-rate + .link-btn {
	margin-left: 0;
}
.drawer.collapsed .drawer-body {
	display: none;
}
.drawer-body {
	display: flex;
	flex-direction: column;
	height: min(300px, 36vh);
	border-top: 1px solid var(--rule);
}
.ev-toolbar {
	flex: none;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 6px 24px;
	border-bottom: 1px solid var(--rule);
}
.ev-chips {
	display: flex;
	gap: 6px;
}
.ev-chips .fchip {
	background: none;
	border: 1px solid var(--rule);
	color: var(--ink-3);
}
.ev-chips .fchip.on {
	background: var(--accent-tint);
	border-color: #c7d7fe;
	color: var(--accent-ink);
}
.ev-toolbar select {
	height: 28px;
	padding: 0 6px;
	font-size: 12.5px;
	border-radius: 7px;
}
.ev-toolbar .link-btn {
	margin-left: auto;
	font-size: 12.5px;
}
.ev-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	font: 12px/1.55 var(--mono);
}
.ev {
	display: grid;
	grid-template-columns: 92px 170px 160px minmax(0, 1fr);
	gap: 10px;
	padding: 1px 24px;
	border-bottom: 1px solid #f3f4f6;
	cursor: pointer;
}
.ev:hover {
	background: var(--hover);
}
.ev .ts { color: var(--ink-3); }
.ev .ty { color: var(--ink-2); }
.ev .pr { color: var(--ink); }
.ev .dt {
	color: var(--ink-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ev.t-tool .ty { color: var(--accent); }
.ev.t-err .ty { color: var(--signal); }
.ev.t-human .ty,
.ev.t-int .ty { color: var(--wait-ink); }
.ev.t-find .ty { color: var(--ok-ink); }
.ev.open .dt {
	white-space: normal;
	word-break: break-word;
}
.ev pre {
	grid-column: 1 / -1;
	margin: 4px 0 6px;
	padding: 8px 10px;
	background: var(--bg);
	border: 1px solid var(--rule);
	border-radius: 8px;
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-word;
	cursor: text;
}


/* ─── report modal: a research document on paper ───────────────────────── */

.modal {
	position: fixed;
	inset: 0;
	z-index: 70;
	display: flex;
	align-items: stretch;
	justify-content: center;
	padding: 24px;
	background: rgba(31, 37, 40, 0.45);
	animation: fadein 0.15s ease-out;
}
.modal-card {
	display: flex;
	flex-direction: column;
	width: min(940px, 100%);
	max-height: 100%;
	border-radius: 12px;
	background: var(--paper);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}
.modal-card:focus {
	outline: none;
}
.modal-head {
	flex: none;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 18px;
	border-bottom: 1px solid var(--rule);
	background: var(--surface);
}
.modal-head .label {
	flex: 1;
	min-width: 0;
	font-size: 14px;
	color: var(--ink-2);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.modal-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.btn-ico {
	width: 16px;
	height: 16px;
}
.modal-x {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-left: 4px;
	border: 0;
	border-radius: 50%;
	background: var(--ink);
	color: #fbf8f2;
	cursor: pointer;
	transition: background 0.15s;
}
.modal-x:hover {
	background: #000;
}
.modal-x svg {
	width: 17px;
	height: 17px;
}
.modal-scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 36px 24px 56px;
}
.help-modal {
	align-items: center;
}
.help-card {
	width: min(1000px, 100%);
	max-height: min(860px, 100%);
	background: var(--paper);
	animation: helpIn 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes helpIn {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.985);
	}
}
.help-head {
	flex: none;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 26px 32px 18px;
	border-bottom: 1px solid var(--rule);
	background: var(--surface);
}
.help-head .eyebrow {
	margin-bottom: 4px;
	color: var(--accent-ink);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 12px;
}
.help-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--rule-strong);
	border-radius: 50%;
	background: var(--surface);
	color: var(--ink-2);
	cursor: pointer;
}
.help-close:hover {
	color: var(--ink);
	border-color: var(--ink-4);
}
.help-close svg {
	width: 15px;
	height: 15px;
}
.help-scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 8px 32px 30px;
}
.help-scroll > section {
	padding: 24px 0 26px;
}
.help-scroll > section + section {
	border-top: 1px solid var(--rule);
}
.help-sec {
	margin-bottom: 18px;
	font: 600 22px/1.25 var(--display);
	letter-spacing: -0.01em;
}
.report-body {
	max-width: 760px;
	margin: 0 auto;
	padding: 48px 56px 56px;
	background: var(--surface);
	border: 1px solid var(--rule);
	box-shadow: var(--shadow);
}
.md {
	font: 16px/1.65 var(--doc-serif);
	color: var(--ink);
	overflow-wrap: anywhere;
}
.md h1 {
	margin: 0 0 18px;
	padding-bottom: 14px;
	border-bottom: 2px solid var(--ink);
	font: 700 32px/1.15 var(--display);
	letter-spacing: -0.01em;
}
.md h2 {
	margin: 36px 0 12px;
	padding-top: 10px;
	border-top: 1px solid var(--rule-strong);
	font: 700 21px/1.3 var(--display);
}
.md h3 {
	margin: 22px 0 6px;
	font: 600 17.5px/1.35 var(--display);
}
.md h4,
.md h5,
.md h6 {
	margin: 16px 0 4px;
	font: 600 15px/1.4 var(--sans);
}
.md p {
	margin: 8px 0;
}
.md ul,
.md ol {
	margin: 8px 0;
	padding-left: 22px;
}
.md ul {
	list-style: disc;
}
.md ol {
	list-style: decimal;
}
.md li {
	margin: 3px 0;
}
.md li.d1 {
	margin-left: 18px;
}
.md li.d2 {
	margin-left: 36px;
}
.md blockquote {
	margin: 14px 0;
	padding: 12px 16px;
	border-left: 3px solid var(--accent);
	background: var(--hover);
	font-size: 15px;
	color: var(--ink-2);
}
.md blockquote p {
	margin: 0;
}
.md code {
	padding: 1px 5px;
	border-radius: 4px;
	background: var(--sunk);
	font: 0.86em var(--mono);
}
.md pre {
	margin: 12px 0;
	padding: 12px 14px;
	border-radius: 6px;
	background: var(--sunk);
	overflow-x: auto;
}
.md pre code {
	padding: 0;
	background: none;
}
.md hr {
	margin: 24px 0;
	border: 0;
	border-top: 1px solid var(--rule);
}
.md .md-table {
	margin: 12px 0;
	overflow-x: auto;
}
.md table {
	border-collapse: collapse;
	font: 14px/1.4 var(--sans);
}
.md th,
.md td {
	padding: 7px 14px 7px 0;
	border-bottom: 1px solid var(--rule);
	text-align: left;
}
.md th {
	font-weight: 700;
	color: var(--ink-3);
}
.md a {
	color: var(--accent-ink);
}
.md a.bare {
	font: 13px var(--mono);
}
.md strong {
	font-weight: 700;
}
.md em {
	color: var(--ink-3);
}

/* ─── smaller screens ───────────────────────────────────────────────────── */

@media (max-width: 1360px) {
	.board {
		grid-template-columns: minmax(400px, 40%) minmax(0, 1fr);
	}
	.mhead,
	.mrow-main {
		grid-template-columns: 40px minmax(0, 1.5fr) minmax(160px, 1fr) minmax(0, 1.2fr) 96px 70px;
		gap: 12px;
	}
}
@media (max-width: 1180px) {
	.hero-title {
		font-size: 46px;
	}
	.hero-stage::before {
		background: linear-gradient(90deg, rgba(244, 241, 234, 0.97) 0%, rgba(244, 241, 234, 0.94) 50%, rgba(244, 241, 234, 0.6) 72%, rgba(244, 241, 234, 0.2) 92%);
	}
	.gloss-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.criteria {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
/* tablets and phones: one column; the team panel follows the dossier, the run bar says what is happening */
@media (max-width: 1020px) {
	.board {
		display: flex;
		flex-direction: column;
		height: auto;
		min-height: 100%;
	}
	main {
		overflow-y: auto;
	}
	.doc,
	.team {
		overflow: visible;
	}
	.doc-scroll {
		overflow: visible;
		padding: 18px 18px 28px;
	}
	.team {
		border-right: 0;
		padding: 18px;
	}
	.live {
		max-height: 60vh;
	}
	/* one pane at a time: the dossier (or the comparison) or the team, chosen with the switch under the run bar */
	body[data-view="case"] .pane-switch {
		position: sticky;
		top: 0;
		z-index: 6;
		display: flex;
		padding: 8px 14px;
		background: var(--surface);
		border-bottom: 1px solid var(--rule);
	}
	/* one control with two halves; the dark thumb slides under the pane on screen */
	.ps-seg {
		position: relative;
		flex: 1;
		display: flex;
		padding: 3px;
		border: 1px solid var(--rule-strong);
		border-radius: 10px;
		background: var(--sunk);
	}
	.ps-thumb {
		position: absolute;
		top: 3px;
		bottom: 3px;
		left: 3px;
		width: calc(50% - 3px);
		border-radius: 7px;
		background: var(--ink);
		box-shadow: var(--shadow);
		transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.2, 1);
	}
	body[data-pane="team"] .ps-thumb {
		transform: translateX(100%);
	}
	body[data-pane="team"] .board > .doc,
	body[data-pane="doc"] .board > .team {
		display: none;
	}
	.ps-btn {
		position: relative;
		flex: 1 1 0;
		min-width: 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 7px;
		height: 36px;
		padding: 0 10px;
		border: 0;
		border-radius: 7px;
		background: none;
		color: var(--ink-3);
		font: 600 14.5px/1 var(--sans);
		white-space: nowrap;
		cursor: pointer;
		transition: color 0.2s;
	}
	.ps-btn[aria-selected="true"] {
		color: #fbf8f2;
	}
	.ps-lbl {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.ps-badge {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		height: 20px;
		padding: 0 6px;
		border-radius: 10px;
		background: var(--surface);
		color: var(--ink-2);
		font-size: 11.5px;
		font-weight: 700;
		transition: background 0.2s, color 0.2s;
	}
	.ps-btn[aria-selected="true"] .ps-badge {
		background: rgba(255, 255, 255, 0.16);
		color: #fbf8f2;
	}
	.ps-dot {
		display: none;
		width: 7px;
		height: 7px;
		border-radius: 50%;
		background: var(--accent-soft);
	}
	.ps-btn.is-live .ps-dot {
		display: inline-block;
		animation: ps-pulse 1.4s ease-in-out infinite;
	}
	/* the findings tabs stick under the switch */
	body[data-view="case"] .tabs-bar {
		top: 61px;
	}
	.mhead {
		display: none;
	}
	.mrow-main {
		grid-template-columns: 40px minmax(0, 1fr) auto;
		grid-template-areas:
			"rk name stat"
			"rk score score"
			"rk chips chips"
			"rk toggle toggle";
		row-gap: 8px;
	}
	.mrow-main .rk { grid-area: rk; align-self: start; }
	.mrow-main .mname { grid-area: name; }
	.mrow-main .mscore { grid-area: score; }
	.mrow-main .mchips { grid-area: chips; }
	.mrow-main .stat { grid-area: stat; }
	.mrow-main .mtoggle { grid-area: toggle; justify-self: start; }
	.mdetail {
		padding: 4px 18px 18px 18px;
	}
}
@media (max-width: 860px) {
	.topbar {
		gap: 12px;
		height: 62px;
		padding: 0 14px;
	}
	.nav-tab {
		padding: 0 10px;
		font-size: 14.5px;
	}
	.top-right {
		gap: 8px;
	}
	.btn.small .hide-sm,
	#btnNew span[data-i18n] {
		display: none;
	}
	/* a picture made for a phone: the papers frame the first screen, its middle stays clean for the headline */
	.hero-stage {
		min-height: 0;
		align-items: flex-start;
		background-image: url("img/desk-phone.webp");
		background-position: center top;
		background-size: 100% auto;
	}
	/* the collage shows behind the headline; the veil thickens toward the form and the examples */
	.hero-stage::before {
		background: linear-gradient(180deg, rgba(244, 241, 234, 0.22) 0, rgba(244, 241, 234, 0.4) 120vw, var(--paper) 176vw);
	}
	.hero-title,
	.hero-lede {
		text-shadow: 0 0 14px rgba(244, 241, 234, 0.95), 0 0 3px rgba(244, 241, 234, 0.9);
	}
	:root {
		--page-gutter: 18px;
	}
	.hero-inner {
		padding: 34px var(--page-gutter) 36px;
	}
	.hero-title {
		font-size: 36px;
	}
	.hero-lede {
		font-size: 16px;
	}
	.hero-sheet {
		padding: 0 18px 36px;
	}
	.how-steps {
		grid-template-columns: 1fr;
		gap: 18px;
	}
	.how-steps li,
	.how-steps li + li {
		padding: 0 0 18px;
		border-left: 0;
		border-bottom: 1px solid var(--rule);
	}
	.how-n,
	.how-steps li:last-child .how-n {
		right: 0;
	}
	.gloss-grid,
	.ent-groups,
	.inst-list,
	.m-areas,
	.status-help dl {
		grid-template-columns: 1fr;
	}
	.src-card {
		width: 228px;
		scroll-snap-align: start;
	}
	/* a row to swipe that moves on by itself (js/help.js) instead of the moving band: a band thousands of pixels wide is
	   not always painted in time on a phone, and its cards blink out */
	.src-marquee {
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding: 0 var(--page-gutter);
		padding: 6px var(--page-gutter) 12px;
		scrollbar-width: none;
	}
	.src-marquee::-webkit-scrollbar {
		display: none;
	}
	.src-track {
		padding-right: var(--page-gutter);
		animation: none;
	}
	.src-track .dup {
		display: none;
	}
	.sources.band {
		padding: 44px 0 40px;
	}
	.sources.band .sheet-title {
		font-size: 27px;
	}
	.sources.band .src-head {
		margin-bottom: 20px;
	}
	.try.band {
		padding: 48px var(--page-gutter) 56px;
	}
	.try-inner {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 44px;
	}
	.try .sheet-title {
		font-size: 27px;
	}
	.try-lede {
		font-size: 16px;
	}
	.try-card {
		justify-self: center;
	}
	.try-qr {
		width: 210px;
		height: 210px;
	}
	.help-card {
		max-height: 100%;
		border-radius: 0;
	}
	.help-head {
		padding: 18px 18px 14px;
	}
	.help-scroll {
		padding: 4px 18px 24px;
	}
	.runbar {
		padding: 8px 14px;
	}
	.step + .step::before {
		width: 14px;
	}
	.step-txt small {
		display: none;
	}
	.doc-head {
		flex-direction: column;
		gap: 10px;
	}
	.doc-actions {
		padding-top: 0;
	}
	.serif-title {
		font-size: 25px;
	}
	.card-head,
	.signals #signalsBody,
	.entities,
	.tabs-bar {
		padding-left: 16px;
		padding-right: 16px;
	}
	.finding {
		padding: 16px 16px 14px 20px;
	}
	.timeline-key ul {
		grid-template-columns: 1fr;
	}
	.report-body {
		padding: 28px 22px 36px;
	}
	.modal {
		padding: 0;
	}
	.modal-card {
		border-radius: 0;
	}
	.modal-scroll {
		padding: 12px 0 32px;
	}
	.modal-head {
		flex-wrap: wrap;
	}
}
@media (max-width: 560px) {
	.wordmark {
		display: none;
	}
	.topbar {
		gap: 6px;
		padding: 0 10px;
	}
	.nav-tab {
		padding: 0 8px;
		font-size: 14px;
	}
	.nav-tab .lbl-full {
		display: none;
	}
	.nav-tab .lbl-short {
		display: inline;
	}
	/* a lead is added from the "Osobe i firme" card; the top bar keeps the button only for open questions */
	.inbox-btn:not(.has-open) {
		display: none;
	}
	/* the run bar names only the phase that is running now */
	.step:not(.is-active) .step-txt {
		display: none;
	}
	/* a card's hint goes under its title instead of squeezing it onto two lines */
	.card-head {
		flex-wrap: wrap;
		row-gap: 2px;
	}
	/* an agent's lane keeps room for its name: no "new" badge, a shorter status */
	.lane-spawn {
		display: none;
	}
	.lane-status {
		max-width: 38%;
	}
	/* a signal's status goes under its title, so the title keeps the width */
	.sig-row {
		grid-template-columns: 26px minmax(0, 1fr);
		gap: 6px 10px;
	}
	.sig-row .stat {
		grid-column: 2;
		justify-self: start;
	}
	.sig-row.group {
		grid-template-columns: 26px minmax(0, 1fr) 18px;
	}
	.sig-row.group .stat {
		grid-row: 2;
	}
	.sig-row.group .sig-chev {
		grid-column: 3;
		grid-row: 1;
	}
	.lang-btn {
		min-width: 30px;
		padding: 0 5px;
	}
	.help-btn {
		width: 30px;
		height: 30px;
		flex: none;
	}
	.start-row {
		flex-direction: column;
	}
	.start-row input[type="text"] {
		flex: none;
	}
	.start-row .btn {
		width: 100%;
	}
	.start-icon {
		top: 25px;
	}
	.example-grid,
	.criteria {
		grid-template-columns: 1fr;
	}
	.hero-title {
		font-size: 31px;
	}
	.srow {
		grid-template-columns: 24px minmax(0, 1fr);
	}
	.srow .rt {
		display: none;
	}
	.srow .rs {
		grid-column: 2;
		justify-self: start;
	}
}

/* the smallest phones (320–400 px): the top bar stays on one line (the logo starts a new dossier, like "+") */
@media (max-width: 400px) {
	#btnNew {
		display: none;
	}
	.topbar {
		padding: 0 8px;
	}
	.nav-tab {
		padding: 0 6px;
	}
	.top-right {
		gap: 6px;
	}
	.ps-btn {
		gap: 6px;
		padding: 0 8px;
		font-size: 14px;
	}
	.ps-unit {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
	.src-track {
		flex-wrap: wrap;
		width: auto;
	}
	.src-track .dup {
		display: none;
	}
	.src-marquee {
		padding: 6px var(--page-gutter) 10px;
	}
}

/* ─── print: only the report ────────────────────────────────────────────── */

@media print {
	@page {
		size: A4;
		margin: 20mm 20mm 22mm;
		@bottom-center {
			content: counter(page) " / " counter(pages);
			font: 9pt var(--doc-serif);
			color: #666;
		}
	}
	html,
	body {
		height: auto !important;
		overflow: visible !important;
		background: #fff !important;
		color: #000 !important;
	}
	body.modal-open > *:not(#reportModal) {
		display: none !important;
	}
	body.modal-open #reportModal {
		position: static !important;
		display: block !important;
		padding: 0 !important;
		background: none !important;
	}
	body.modal-open .modal-card {
		display: block !important;
		width: auto !important;
		max-height: none !important;
		border: 0 !important;
		box-shadow: none !important;
		overflow: visible !important;
	}
	body.modal-open .modal-head {
		display: none !important;
	}
	body.modal-open .modal-scroll {
		display: block !important;
		overflow: visible !important;
	}
	body.modal-open .report-body {
		max-width: none;
		margin: 0;
		padding: 0 !important;
		border: 0 !important;
		box-shadow: none !important;
	}
	.md {
		font: 11pt/1.5 var(--doc-serif);
		color: #000;
	}
	.md,
	.md * {
		color: #000 !important;
	}
	.md blockquote {
		background: none;
		border-left-color: #888;
	}
	.md h1 {
		font-size: 21pt;
		margin: 0 0 8pt;
	}
	.md h2 {
		font-size: 14pt;
		margin: 20pt 0 6pt;
		padding-bottom: 3pt;
		border-bottom: 0.5pt solid #888;
		break-after: avoid;
	}
	.md h3 {
		font-size: 11.5pt;
		margin: 12pt 0 2pt;
		break-after: avoid;
	}
	.md p,
	.md li {
		orphans: 3;
		widows: 3;
	}
	.md-sec,
	.md tr,
	.md blockquote,
	.md pre {
		break-inside: avoid;
	}
	.md a {
		text-decoration: underline;
		text-underline-offset: 1.5pt;
	}
	/* the full address would run over many lines: print the domain after the title, the link stays underlined */
	.md a[data-host]:not(.bare)::after {
		content: " (" attr(data-host) ")";
		font-size: 8pt;
		color: #555 !important;
	}
	.md table {
		font-size: 9.5pt;
	}
}
