/* ============================================================
   Violet — the dev-side page (proposal)
   ------------------------------------------------------------
   Loaded after area.css and violet.css (which draws the tree).
   This side shows the same store from a prompt, then the result
   envelope, the packages, the code and the value validators.
   Tokens only: no hex values, no px font sizes.
   ============================================================ */

/* ── Fig. 01: the prompt and the store ───────────────────────── */

.vterm-stage {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	align-items: stretch;
	gap: var(--space-5);
}

.vterm {
	height: 620px;
	min-width: 0;
	border: var(--rule-thin) solid var(--color-on-dark-line);
	background: var(--afd-black);
}

.vterm .terminal-screen {
	font-size: var(--t-code);
}

/* Named chips, so all of them fit; the line itself lands on the prompt. */
.vterm .terminal-tries {
	flex-wrap: wrap;
	overflow: visible;
}

.vterm .terminal-tries button {
	font-family: var(--font-sans);
	font-size: var(--t-code);
	font-weight: var(--weight-medium);
}

.vterm-tree {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: var(--space-5);
	border: var(--rule-thin) solid var(--color-on-dark-line);
}

/* Three leaves across a narrower column than the design side's stage. */
.vterm-tree .vtree {
	--tile: clamp(108px, 9vw, 132px);
	--k: 0.5;
	--drop: 14px;
	margin-block: auto;
}

.vterm-tree .vtree li {
	padding-inline: var(--space-1);
}

.vterm-tree .vnode {
	padding: var(--space-1);
}

.vterm-tree .vnode-head span {
	display: none;
}

.vterm-note {
	margin-top: var(--space-5);
	color: var(--color-on-dark-muted);
	font-size: var(--t-small);
	line-height: var(--leading-body);
}

.vterm-note a {
	color: var(--accent-agent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.where code,
.vsafe-note code {
	font-family: var(--mono);
	font-size: 0.9em;
}

/* ── Fig. 05: the validators ─────────────────────────────────── */

.vsafe {
	display: grid;
	grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
	gap: var(--space-4) var(--space-5);
	margin-top: var(--space-8);
}

.vsafe label {
	display: grid;
	gap: var(--space-2);
	min-width: 0;
}

.vsafe .mono {
	color: var(--color-on-dark-muted);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
}

.vsafe select,
.vsafe input {
	min-width: 0;
	min-height: 48px;
	padding: 0 var(--space-4);
	border: var(--rule-thin) solid var(--afd-stone-600);
	border-radius: 0;
	background: var(--afd-black);
	color: var(--color-on-dark);
	font: var(--t-small) var(--mono);
}

.vsafe input:focus-visible,
.vsafe select:focus-visible {
	border-color: var(--accent-agent);
}

.vsafe-out,
.vsafe-tries {
	grid-column: 1 / -1;
}

.vsafe-out {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: var(--space-4);
	padding: var(--space-5);
	border-left: var(--rule-heavy) solid var(--accent-agent);
	background: var(--afd-ink-raised);
	font: var(--t-small) / 1.6 var(--mono);
	overflow-wrap: anywhere;
}

.vsafe-out[data-safe="false"] {
	border-left-color: var(--afd-red-300);
}

.vsafe-verdict {
	padding: var(--space-1) var(--space-3);
	background: var(--accent-agent);
	color: var(--color-on-accent);
	font: var(--weight-strong) var(--t-label) / 1.5 var(--mono);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	white-space: nowrap;
}

.vsafe-out[data-safe="false"] .vsafe-verdict {
	background: var(--afd-red-300);
}

.vsafe-result {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	color: var(--accent-agent);
}

.vsafe-out[data-safe="false"] .vsafe-result {
	color: var(--afd-red-200);
}

.vsafe-result .vswatch {
	border-color: var(--color-on-dark);
}

.vsafe-tries {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
}

.vsafe-tries button {
	padding: var(--space-1) var(--space-2);
	border: var(--rule-thin) solid var(--afd-stone-700);
	background: transparent;
	color: var(--color-on-dark-muted);
	font: var(--t-label) / 1.6 var(--mono);
	cursor: pointer;
}

.vsafe-tries button:hover {
	border-color: var(--accent-agent);
	color: var(--accent-agent);
}

.vsafe-note {
	max-width: 760px;
	margin-top: var(--space-6);
	color: var(--color-on-dark-muted);
	font-size: var(--t-small);
	line-height: var(--leading-body);
}

.vsafe-note code {
	color: var(--accent-agent);
}

/* ── Fig. 06: where the tree lives ───────────────────────────── */

.where {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-8);
	margin-top: var(--heading-gap);
}

.where h3 {
	font-size: var(--t-title);
	font-weight: var(--weight-medium);
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.where-list {
	margin: var(--space-5) 0 0;
}

.where-list > div {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
	gap: var(--space-4);
	padding-block: var(--space-4);
	border-top: var(--rule-thin) solid var(--color-line);
}

.where-list > div:first-child {
	border-top: var(--rule) solid var(--color-rule);
}

.where-list dt {
	font: var(--weight-medium) var(--t-small) / 1.6 var(--mono);
	overflow-wrap: anywhere;
}

.where-list dd {
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--t-small);
	line-height: var(--leading-body);
}

.where-command {
	margin-top: var(--space-4);
	padding: var(--space-4) var(--space-5);
	background: var(--color-code-bg);
	color: var(--color-code-text);
}

.where-command code {
	font-size: var(--t-small);
}

/* ── Narrower screens ────────────────────────────────────────── */

@media (max-width: 1100px) {
	.vterm-stage,
	.where {
		grid-template-columns: minmax(0, 1fr);
	}

	.vterm {
		height: 520px;
	}

	.vterm-tree .vtree {
		--tile: 150px;
		--k: 0.56;
	}

	.where {
		gap: var(--space-7);
	}
}

@media (max-width: 850px) {
	.vsafe {
		grid-template-columns: minmax(0, 1fr);
	}

	.vsafe-out {
		grid-template-columns: minmax(0, 1fr);
		justify-items: start;
		gap: var(--space-3);
	}
}

@media (max-width: 620px) {
	.vterm {
		height: 460px;
	}

	.vterm-tree {
		padding: var(--space-3);
	}

	.vterm-tree .vtree {
		--tile: 104px;
		--k: 0.44;
	}

	.where-list > div {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-1);
	}
}
