/* ============================================================
   Uhr-Baukasten - ergaenzt style.css der Site
   ============================================================ */

.bk-head { max-width: 84rem; }

.bk {
	max-width: 84rem;
	margin: 2rem auto 3rem;
	padding: 0 1.5rem;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 1.75rem;
	align-items: start;
}

/* -- Schritte ------------------------------------------------- */
.bk-schritte {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-bottom: 0.9rem;
}

.bk-schritt {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.42rem 0.8rem;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: #6b7684;
	background: #f6f8fa;
	border: 1px solid #d0d6de;
	border-radius: 6px;
	cursor: pointer;
	transition: background .12s, border-color .12s, color .12s;
}

.bk-schritt:hover { background: #e9edf2; color: #1d2530; }
.bk-schritt:focus-visible { outline: 2px solid #d4372c; outline-offset: 1px; }

.bk-schritt[aria-selected="true"] {
	background: #1d2530;
	border-color: #1d2530;
	color: #fff;
}

.bk-schritt .bk-nr {
	font-size: 0.68rem;
	opacity: 0.6;
	font-variant-numeric: tabular-nums;
}

/* Add-on-Schritte heben sich leicht ab */
.bk-schritt.is-addon { border-style: dashed; }
.bk-schritt.is-addon[aria-selected="true"] { border-style: solid; }

.bk-editor { min-height: 20rem; }

.bk-editor h2 {
	margin: 0 0 0.3rem;
	font-size: 1.05rem;
	font-weight: 600;
	color: #1d2530;
}

.bk-editor .bk-satz {
	margin: 0 0 1.2rem;
	font-size: 0.88rem;
	color: #6b7684;
	line-height: 1.5;
}

.bk-abschnitt {
	margin: 1.5rem 0 0.8rem;
	padding-top: 0.9rem;
	border-top: 1px solid #e3e7ec;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #1d2530;
}

.bk-felder {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
	gap: 0 1.25rem;
}

.bk-felder > .bk-abschnitt { grid-column: 1 / -1; }

.bk-feld.is-breit { grid-column: 1 / -1; }

.bk-hilfe {
	margin: 0.3rem 0 0;
	font-size: 0.74rem;
	color: #8b95a3;
	line-height: 1.4;
}

.bk-zahl {
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

.bk-zahl .pg-range { flex: 1 1 auto; margin: 0; }

.bk-zahl .pg-input {
	width: 5.2rem;
	flex: 0 0 auto;
	padding: 0.3rem 0.45rem;
	font-size: 0.84rem;
	font-variant-numeric: tabular-nums;
}

.bk-leeren {
	flex: 0 0 auto;
	width: 1.7rem;
	height: 1.7rem;
	padding: 0;
	border: 1px solid #d0d6de;
	border-radius: 5px;
	background: #fff;
	color: #8b95a3;
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.bk-leeren:hover { color: #d4372c; border-color: #d4372c; }

.bk-farbe {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.bk-farbe input[type="color"] {
	width: 2.6rem;
	height: 1.9rem;
	padding: 0;
	border: 1px solid #d0d6de;
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
}

.bk-farbe input[type="color"]:disabled { opacity: 0.35; cursor: default; }

.bk-farbe code {
	font-size: 0.72rem;
	color: #8b95a3;
}

textarea.pg-input {
	min-height: 4.5rem;
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
	font-size: 0.8rem;
	resize: vertical;
}

.pg-input.is-fehler { outline: 2px solid #d4372c; outline-offset: -1px; }

/* -- Nav unter dem Editor ------------------------------------ */
.bk-nav {
	display: flex;
	justify-content: space-between;
	gap: 0.6rem;
	margin-top: 0.9rem;
}

.bk-nav .pg-btn { flex: 0 0 auto; min-width: 7.5rem; }
.bk-nav .pg-btn:disabled { opacity: 0.35; cursor: default; }

/* -- Karten (Vorlagen und Add-ons) ---------------------------- */
.bk-karten {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
	gap: 0.8rem;
}

.bk-karte {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	padding: 0.9rem;
	text-align: left;
	font: inherit;
	color: inherit;
	background: #f9fafb;
	border: 1px solid #dde1e7;
	border-radius: 8px;
}

button.bk-karte { cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }

button.bk-karte:hover {
	border-color: #1d2530;
	box-shadow: 0 2px 10px rgba(29, 37, 48, .08);
	transform: translateY(-1px);
}

.bk-karte.is-an { border-color: #1d2530; background: #fff; }

.bk-karte-bild {
	display: grid;
	place-items: center;
	padding: 0.4rem 0;
}

.bk-karte-bild .analogclock { --ac-size: 6.5rem; }

.bk-karte-titel { font-weight: 600; font-size: 0.9rem; color: #1d2530; }
.bk-karte-satz { font-size: 0.78rem; color: #6b7684; line-height: 1.45; flex: 1 1 auto; }

.bk-karte-name {
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
	font-size: 0.7rem;
	color: #8b95a3;
}

.bk-karte-fuss {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.bk-karte-fuss .pg-btn { flex: 0 0 auto; padding: 0.3rem 0.6rem; font-size: 0.78rem; }

.bk-instanzen {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	width: 100%;
}

.bk-instanz {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: #3a4553;
}

.bk-instanz-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.bk-instanz .bk-knopfgruppe { flex: 0 0 auto; }

/* Symbolknoepfe als Gruppe: einstellen · weiteres · entfernen */
.bk-knopfgruppe {
	display: inline-flex;
}

.bk-symbol {
	display: grid;
	place-items: center;
	width: 2.1rem;
	height: 2rem;
	padding: 0;
	color: #3a4553;
	background: #f6f8fa;
	border: 1px solid #d0d6de;
	cursor: pointer;
	transition: background .12s, color .12s;
}

.bk-symbol + .bk-symbol { margin-left: -1px; }
.bk-symbol:first-child { border-radius: 5px 0 0 5px; }
.bk-symbol:last-child { border-radius: 0 5px 5px 0; }
.bk-symbol svg { width: 1rem; height: 1rem; }
.bk-symbol:hover:not(:disabled) { background: #e9edf2; color: #1d2530; position: relative; }
.bk-symbol:focus-visible { outline: 2px solid #d4372c; outline-offset: 1px; position: relative; z-index: 1; }
.bk-symbol.is-primary { background: #1d2530; border-color: #1d2530; color: #fff; }
.bk-symbol.is-primary:hover { background: #2b3441; color: #fff; }
.bk-symbol:last-child:hover:not(:disabled) { color: #d4372c; }
.bk-symbol:disabled { color: #c3c9d1; cursor: not-allowed; }

.bk-zaehler {
	margin-left: auto;
	font-size: 0.72rem;
	font-weight: 700;
	color: #fff;
	background: #d4372c;
	border-radius: 999px;
	padding: 0.1rem 0.5rem;
}

.bk-gruppe-titel {
	margin: 1.3rem 0 0.6rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #8b95a3;
}

.bk-gruppe-titel:first-of-type { margin-top: 0; }

.bk-kopf {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.bk-kopf .pg-row { flex: 0 0 auto; }
.bk-kopf .pg-btn { flex: 0 0 auto; padding: 0.3rem 0.65rem; font-size: 0.78rem; }

.bk-doku { font-size: 0.78rem; color: #d4372c; text-decoration: none; }
.bk-doku:hover { text-decoration: underline; }

/* -- Export --------------------------------------------------- */
.bk-code {
	position: relative;
	margin: 0 0 1.2rem;
}

.bk-code pre {
	margin: 0;
	max-height: 22rem;
	overflow: auto;
	padding: 1rem 1.1rem;
	background: #1d2530;
	color: #d7dae0;
	border-radius: 8px;
	font: 0.78rem/1.55 ui-monospace, "SF Mono", Consolas, monospace;
	white-space: pre;
}

.bk-code .bk-kopieren {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	padding: 0.25rem 0.6rem;
	font: inherit;
	font-size: 0.72rem;
	color: #d7dae0;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 5px;
	cursor: pointer;
}

.bk-code .bk-kopieren:hover { background: rgba(255, 255, 255, .16); }

.bk-reiter {
	display: flex;
	gap: 0.3rem;
	margin-bottom: 0.6rem;
}

.bk-dateien {
	margin: 0 0 1.2rem;
	padding: 0;
	list-style: none;
	font-size: 0.82rem;
}

.bk-dateien li { padding: 0.15rem 0; }
.bk-dateien a { color: #1d2530; }

/* -- Rechte Spalte -------------------------------------------- */
.bk-rechts {
	position: sticky;
	top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

.bk-buehne {
	display: grid;
	place-items: center;
	min-height: 26rem;
	padding: 1.5rem;
	border: 1px solid #dde1e7;
	border-radius: 10px;
	overflow: hidden;
	transition: background-color .2s;
}

.bk-buehne[data-grund="hell"] { background: #fff; }
.bk-buehne[data-grund="dunkel"] { background: #1b1f26; border-color: #1b1f26; }
.bk-buehne[data-grund="karo"] {
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #e6e9ee 25%, transparent 25%),
		linear-gradient(-45deg, #e6e9ee 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e6e9ee 75%),
		linear-gradient(-45deg, transparent 75%, #e6e9ee 75%);
	background-size: 18px 18px;
	background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.bk-rahmen {
	position: relative;
	line-height: 0;
}

.bk-uhr .analogclock { --ac-size: var(--bk-groesse, 340px); }

/* Ziehgriff unten rechts - wie ein Fenstergriff */
.bk-griff {
	position: absolute;
	right: -10px;
	bottom: -10px;
	width: 18px;
	height: 18px;
	cursor: nwse-resize;
	touch-action: none;
	opacity: 0.45;
	background:
		linear-gradient(135deg, transparent 45%, #8b95a3 45%, #8b95a3 55%, transparent 55%),
		linear-gradient(135deg, transparent 70%, #8b95a3 70%, #8b95a3 80%, transparent 80%);
}

.bk-griff:hover,
.bk-rahmen.is-ziehen .bk-griff { opacity: 1; }

.bk-werkzeug {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
}

.bk-gruppe {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.bk-mass {
	margin-left: 0.3rem;
	font-size: 0.75rem;
	color: #8b95a3;
	font-variant-numeric: tabular-nums;
}

.bk-voll {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.bk-voll svg { width: 0.95em; height: 0.95em; }

.bk-status {
	margin: 0;
	min-height: 1.2em;
	font-size: 0.78rem;
	color: #8b95a3;
	text-align: center;
}

.bk-modal-uhr .analogclock { --ac-size: min(100vw, 100svh); }

/* -- Schmal: Uhr oben, Editor darunter ------------------------ */
@media (max-width: 900px) {
	.bk { grid-template-columns: 1fr; }
	.bk-rechts { position: static; order: -1; }
	.bk-buehne { min-height: 0; }
}

/* Haken im Export ("CSS einbetten") */
.bk-check {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.5rem;
	font-size: 0.88rem;
	cursor: pointer;
}
