/* Org chart maker. Input on the left, picture on the right; stacked on narrow screens. */
[hidden] {
	display: none !important;
}

.ocm {
	display: grid;
	grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}
.ocm-input,
.ocm-output {
	min-width: 0;
}

.ocm-samples {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}
.ocm-label {
	font-weight: 500;
}
.ocm-chips {
	display: inline-flex;
	gap: 6px;
}
.ocm-chip {
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: 0.875rem;
	cursor: pointer;
}
.ocm-chip:hover {
	border-color: var(--accent);
	color: var(--accent);
}
.ocm-chip[aria-pressed='true'] {
	border-color: var(--accent);
	background: var(--accent);
	color: #ffffff;
}
.ocm-chip--restore {
	border-color: var(--accent);
	color: var(--accent);
	font-weight: 500;
}

/* Indentation is the input, so the box uses a font where spaces line up. */
.ocm-text {
	white-space: pre;
	overflow-x: auto;
	tab-size: 4;
}
#ocm-mode {
	margin-bottom: 6px;
	color: var(--text-soft);
	font-size: 0.875rem;
	font-weight: 400;
}
.ocm-input code {
	padding: 0 4px;
	border-radius: 4px;
	background: var(--surface);
	font-size: 0.95em;
}
.ocm-notes {
	margin: 10px 0 0;
	padding: 8px 12px;
	border-radius: 8px;
	background: #fff6e0;
	color: #6b4e00;
	font-size: 0.875rem;
	list-style: none;
}

.ocm-options {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin-bottom: 12px;
}
.ocm-seg {
	display: inline-flex;
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
}
.ocm-seg button {
	min-height: 34px;
	padding: 0 12px;
	border: 0;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: 0.875rem;
	cursor: pointer;
}
.ocm-seg button + button {
	border-left: 1px solid var(--border);
}
.ocm-seg button:hover {
	background: var(--surface);
}
.ocm-seg button[aria-pressed='true'] {
	background: var(--accent);
	color: #ffffff;
}
.ocm-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	cursor: pointer;
}
.ocm-check:has(input:disabled) {
	color: var(--text-soft);
	cursor: default;
}

/* Colour: the shared '색' button (src/tools/_shared/color-choice.js, styles in site.css) sits at the
   right end of the options row, apart from the layout options. */
.ocm-color {
	margin-left: auto;
}

.ocm-wide {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-bottom: 12px;
	padding: 8px 8px 8px 12px;
	border-radius: 8px;
	background: var(--accent-soft);
	font-size: 0.875rem;
}
.ocm-wide > span {
	flex: 1 1 200px;
}
.ocm-wide__close {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--text-soft);
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}
.ocm-wide__close:hover {
	background: var(--bg);
}

.ocm-stage {
	display: flex;
	min-height: 240px;
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #ffffff;
	overflow: auto;
}
.ocm-stage svg {
	display: block;
	flex: none;
	margin: auto;
}
/* Shrinks to fit but never grows. The picture carries its own size in width and height. */
.ocm-stage[data-fit='fit'] svg {
	flex: 0 1 auto;
	max-width: 100%;
	height: auto;
}
.ocm-stage[data-fit='full'] {
	max-height: 75vh;
}
.ocm-empty {
	margin: auto;
	color: var(--text-soft);
	font-size: 0.925rem;
}

.ocm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.ocm-status {
	min-height: 1.5em;
	margin: 8px 0 0;
	color: var(--accent);
	font-size: 0.875rem;
}
.ocm-status[data-error] {
	color: #b42318;
}
.ocm-output .field-hint {
	margin-top: 2px;
}

@media (max-width: 760px) {
	.ocm {
		grid-template-columns: minmax(0, 1fr);
	}
	/* Keeps the picture close to the box it comes from. The box can still be dragged taller. */
	.ocm-text {
		height: 220px;
	}
	.ocm-actions .button {
		flex: 1 1 40%;
		padding: 0 8px;
	}
}
