.project-launch {
	display: flex;
	width: 100%;
	justify-content: space-between;
	align-items: center;
	min-height: 56px;
	padding: 12px 2px;
	border: 0;
	background: transparent;
	color: var(--accent);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.project-launch:hover {
	color: var(--ink);
}

.project-launch span {
	color: var(--muted);
	font-size: 0.9rem;
}

.project-launch:hover span {
	color: var(--accent);
}

.project-dialog {
	width: min(900px, calc(100% - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	overflow-y: auto;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--paper);
	color: var(--ink);
	box-shadow: 0 20px 64px rgb(18 32 38 / 24%);
}

.project-dialog::backdrop {
	background: rgb(18 32 38 / 58%);
}

.dialog-panel {
	position: relative;
	padding: 24px 28px 20px;
}

.dialog-panel.is-loading > :not(.dialog-header):not([data-project-loading]),
.dialog-panel.is-loading .dialog-header > div {
	display: none;
}

.dialog-loading {
	display: none;
}

.dialog-panel.is-loading .dialog-loading {
	display: grid;
	min-height: 180px;
	place-items: center;
	margin: 0;
	color: var(--muted);
	text-align: center;
}

.dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
}

.dialog-eyebrow {
	margin: 0 0 2px;
	color: var(--muted);
	font-size: 0.82rem;
}

.dialog-header h2 {
	margin: 0;
	font-size: 1.45rem;
}

.dialog-title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
}

.dialog-code-link {
	font-size: 0.9rem;
}

.project-input-guide {
	position: relative;
	font-size: 0.85rem;
}

.project-input-guide summary {
	color: var(--accent);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.project-input-guide summary:focus-visible {
	border-radius: 2px;
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.input-guide-content {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	z-index: 2;
	width: min(420px, calc(100vw - 64px));
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--paper);
	box-shadow: 0 8px 24px rgb(18 32 38 / 16%);
	color: var(--ink);
	line-height: 1.5;
}

.input-guide-content p {
	margin: 0;
}

.input-guide-content p + p {
	margin-top: 8px;
}

.dialog-close {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--paper);
	color: var(--ink);
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.dialog-close:hover {
	background: var(--wash);
}

.dialog-description {
	margin: 16px 0;
	color: var(--muted);
}

.project-inputs {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 12px 18px;
	margin: 0 0 16px;
}

.project-inputs[hidden] {
	display: none;
}

.project-input-field {
	display: grid;
	gap: 4px;
	min-width: 130px;
	color: var(--muted);
	font-size: 0.88rem;
}

.project-input-field input,
.project-input-field textarea {
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--paper);
	color: var(--ink);
	font: inherit;
	font-variant-numeric: tabular-nums;
}

.project-input-field textarea {
	min-width: min(420px, calc(100vw - 64px));
	resize: vertical;
	font-variant-numeric: normal;
}

.project-input-field input:focus-visible,
.project-input-field textarea:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.project-input-field input[type="file"] {
	max-width: 100%;
	font-size: 0.82rem;
}

.project-input-field input[type="checkbox"] {
	width: auto;
	min-height: 0;
	justify-self: start;
}

.project-input-help {
	max-width: 260px;
	font-size: 0.78rem;
	line-height: 1.4;
}

.plot-frame {
	width: 100%;
	border: 1px solid var(--line);
	background: var(--paper);
}

.plot-frame canvas {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

.plot-frame [hidden] {
	display: none;
}

.project-video {
	display: block;
	width: 100%;
	max-height: min(65dvh, 600px);
	aspect-ratio: 16 / 9;
	background: #111111;
}

.plot-readout {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 20px;
	padding: 12px 0 4px;
	font-variant-numeric: tabular-nums;
}

.plot-readout output:last-child {
	font-family: Consolas, "Courier New", monospace;
}

.runtime-status {
	min-height: 1.5em;
	margin: 2px 0 12px;
	color: var(--muted);
	font-size: 0.9rem;
}

.dialog-controls {
	display: flex;
	gap: 10px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}

.control-button {
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--accent);
	border-radius: 4px;
	background: var(--accent);
	color: #ffffff;
	font: inherit;
	cursor: pointer;
}

.control-button-secondary {
	background: var(--paper);
	color: var(--accent);
}

.control-button:hover:not(:disabled) {
	filter: brightness(0.92);
}

.control-button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

@media (max-width: 600px) {
	.dialog-panel {
		padding: 16px;
	}

	.dialog-header {
		gap: 12px;
	}

	.dialog-header h2 {
		font-size: 1.25rem;
	}

	.input-guide-content {
		left: 0;
		right: 0;
		width: auto;
	}

	.dialog-description {
		margin: 12px 0;
	}

	.project-input-guide {
		position: static;
	}

	.project-inputs {
		gap: 10px;
		margin-bottom: 12px;
	}

	.project-input-field {
		flex: 1 1 120px;
	}

	.project-input-field-file {
		flex-basis: 100%;
	}

	.project-input-field-file input[type="file"] {
		width: 100%;
	}
}
