/* Stundenrechner v2 ([zus_stunden_tool]) – span + weekly Stundenzettel. */
.zh {
	--zh-ink: #10105d;
	--zh-text: #1d1b4b;
	--zh-muted: #63668a;
	--zh-faint: #9a9cb8;
	--zh-line: #e4e2f4;
	--zh-field: #c9c6e6;
	--zh-indigo: #5140f5;
	--zh-indigo-dark: #3b2bd0;
	--zh-teal: #0ea5a0;
	--zh-green: #0a8f5b;
	--zh-red: #c2264b;
	--zh-amber: #b4530a;
	position: relative;
	color: var(--zh-text);
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	text-align: left;
}
.zh *, .zh *::before, .zh *::after { box-sizing: border-box; }
.zh p { margin: 0; margin-bottom: 0 !important; }
.zh [hidden] { display: none !important; }
.zh button { font: inherit; cursor: pointer; }
.zh svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Tabs */
.zh-tabs { display: flex; gap: 6px; width: max-content; max-width: 100%; margin: 0 auto 18px; padding: 5px; background: #fff; border: 1px solid var(--zh-line); border-radius: 16px; box-shadow: 0 6px 20px rgba(32, 26, 107, .06); }
.zh-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; background: transparent; color: var(--zh-muted); font-weight: 700; font-size: .97rem; transition: background .15s ease, color .15s ease; }
.zh-tab small { padding: 2px 7px; border-radius: 6px; background: #e8f7f6; color: #08807c; font-size: .7rem; font-weight: 800; letter-spacing: .02em; }
.zh-tab:hover { color: var(--zh-ink); background: #f5f4ff; }
.zh-tab.is-active { background: linear-gradient(135deg, var(--zh-indigo), #6d5ef0); color: #fff; box-shadow: 0 8px 18px rgba(81, 64, 245, .28); }
.zh-tab.is-active small { background: rgba(255, 255, 255, .2); color: #fff; }
.zh-tab:focus-visible { outline: 3px solid #bbb4ff; outline-offset: 2px; }

/* Cards and fields */
.zh-card { background: #fff; border: 1px solid var(--zh-line); border-radius: 22px; box-shadow: 0 18px 50px rgba(32, 26, 107, .08); }
.zh-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.zh-field > label { color: var(--zh-ink); font-size: .9rem; font-weight: 700; }
.zh-field > label span { color: var(--zh-faint); font-weight: 500; }
.zh-field-row { position: relative; display: flex; gap: 8px; }
.zh input[type="text"], .zh input[type="date"] {
	width: 100%; min-width: 0; min-height: 52px; padding: 10px 14px; border: 1px solid var(--zh-field); border-radius: 13px;
	background: #fff; color: var(--zh-ink); font: inherit; font-size: 1.05rem; font-variant-numeric: tabular-nums;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.zh input.zh-time { font-family: 'Lexend', 'Inter', sans-serif; font-weight: 600; font-size: 1.15rem; letter-spacing: .01em; }
.zh-field-row .zh-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--zh-faint); font-size: .85rem; font-weight: 600; pointer-events: none; }
.zh-field-row input.zh-time { padding-right: 46px; }
.zh input:hover { border-color: #a9a4dc; }
.zh input:focus { outline: none; border-color: var(--zh-indigo); box-shadow: 0 0 0 4px rgba(81, 64, 245, .14); }
.zh input::placeholder { color: #b9bbd2; font-weight: 500; }
.zh-hint { color: var(--zh-muted); font-size: .84rem; line-height: 1.5; }

/* Mode 1: span */
.zh-span { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.zh-span-form { min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.zh-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.zh-presets-label { flex-shrink: 0; white-space: nowrap; margin-right: 4px; color: var(--zh-faint); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.zh-chip { min-height: 34px; padding: 0 12px; border: 1px solid var(--zh-line); border-radius: 999px; background: #faf9ff; color: var(--zh-ink); font-size: .85rem; font-weight: 600; transition: all .15s ease; }
.zh-chip:hover { border-color: #c5bfff; background: #f1efff; }
.zh-chip.is-active { border-color: var(--zh-indigo); background: #efedff; color: var(--zh-indigo); }
.zh-chip:focus-visible { outline: 3px solid #bbb4ff; outline-offset: 1px; }
.zh-span-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, .8fr); gap: 12px 10px; align-items: end; }
.zh-arrow { padding-bottom: 14px; color: var(--zh-faint); font-size: 1.2rem; }
.zh-field-pause { margin-left: 6px; }
.zh-span-form.has-dates .zh-field-row { flex-direction: column; }
.zh-span-form.has-dates .zh-field-row .zh-unit { top: auto; bottom: 16px; transform: none; }
.zh-span-foot { display: grid; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--zh-line); }
.zh-switch { display: inline-flex; align-items: center; gap: 10px; color: var(--zh-ink); font-size: .92rem; font-weight: 600; cursor: pointer; width: max-content; max-width: 100%; }
.zh-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.zh-switch-ui { position: relative; flex-shrink: 0; width: 40px; height: 24px; border-radius: 999px; background: #d9d7ee; transition: background .15s ease; }
.zh-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.zh-switch input:checked + .zh-switch-ui { background: var(--zh-indigo); }
.zh-switch input:checked + .zh-switch-ui::after { transform: translateX(16px); }
.zh-switch input:focus-visible + .zh-switch-ui { outline: 3px solid #bbb4ff; outline-offset: 2px; }

/* Result panel – dark, so the answer is the clear focus */
.zh-result {
	position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 24px; border: 0; color: #fff;
	background: radial-gradient(420px 220px at 100% 0%, rgba(14, 165, 160, .45), transparent 65%), linear-gradient(150deg, #2a1fa8, #17125e 70%);
	box-shadow: 0 24px 60px rgba(32, 26, 107, .28);
}
.zh-result-label { color: #b9b4ff; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.zh-result-main { margin-top: 6px !important; font-family: 'Lexend', 'Inter', sans-serif; font-size: clamp(2.6rem, 6vw, 3.4rem); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.zh-result-main small { font-size: .38em; font-weight: 600; color: #c9c5ff; letter-spacing: 0; }
.zh-result-words { margin-top: 4px !important; color: #d8d5ff; font-size: .95rem; }
.zh-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 14px; }
.zh-tiles div { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); }
.zh-tiles dt { color: #b9b4ff; font-size: .74rem; font-weight: 700; }
.zh-tiles dd { margin: 2px 0 0; font-family: 'Lexend', 'Inter', sans-serif; font-size: 1.12rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.zh-result-note { color: #d8d5ff; font-size: .86rem; line-height: 1.5; }
.zh-result .zh-error { margin-top: 10px !important; padding: 10px 12px; border-radius: 10px; background: rgba(255, 92, 128, .16); color: #ffd3dd; font-weight: 600; font-size: .9rem; }
.zh-result.is-error .zh-result-main, .zh-result.is-error .zh-tiles, .zh-result.is-error .zh-result-words, .zh-result.is-error .zh-result-note { opacity: .35; }
.zh-result .zh-ghost { margin-top: auto; align-self: flex-start; border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; }
.zh-result .zh-ghost:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.zh-result-note + .zh-error + .zh-ghost, .zh-result-note + .zh-ghost { margin-top: 18px; }

/* Buttons */
.zh-ghost { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--zh-field); border-radius: 12px; background: #fff; color: var(--zh-ink); font-size: .9rem; font-weight: 700; transition: all .15s ease; }
.zh-ghost:hover { border-color: var(--zh-indigo); color: var(--zh-indigo); }
.zh-ghost-quiet { border-color: transparent; color: var(--zh-muted); }
.zh-primary { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--zh-indigo), #6d5ef0); color: #fff; font-weight: 700; box-shadow: 0 8px 20px rgba(81, 64, 245, .28); transition: transform .15s ease, box-shadow .15s ease; }
.zh-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(81, 64, 245, .34); }
.zh-ghost:focus-visible, .zh-primary:focus-visible { outline: 3px solid #bbb4ff; outline-offset: 2px; }

/* Mode 2: week */
.zh-week { padding: 22px; background: #fff; border: 1px solid var(--zh-line); border-radius: 22px; box-shadow: 0 18px 50px rgba(32, 26, 107, .08); }
.zh-week-meta { display: grid; grid-template-columns: 1.2fr 1.2fr .8fr .8fr; gap: 12px; margin-bottom: 18px; }
.zh-week-meta input[type="text"] { min-height: 46px; font-size: .98rem; }
.zh-week-meta input.zh-time { font-size: 1.02rem; }
.zh-sheet { border: 1px solid var(--zh-line); border-radius: 16px; overflow: hidden; }
.zh-sheet-head, .zh-sheet-row { display: grid; grid-template-columns: 112px 1fr 1fr .8fr 120px; gap: 10px; align-items: center; padding: 8px 14px; }
.zh-sheet-head { padding-top: 11px; padding-bottom: 11px; background: #f7f6ff; color: var(--zh-muted); font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.zh-sheet-head span:last-child, .zh-day-total { text-align: right; }
.zh-sheet-head span:nth-child(2), .zh-sheet-head span:nth-child(3), .zh-sheet-head span:nth-child(4) { text-align: center; }
.zh-sheet-row { border-top: 1px solid #efedf9; transition: background .15s ease; }
.zh-sheet-row.is-weekend { background: #fcfcfe; }
.zh-sheet-row input[type="text"] { min-height: 44px; padding: 8px 12px; font-size: 1.02rem; text-align: center; }
.zh-day { display: flex; align-items: baseline; gap: 8px; font-weight: 700; color: var(--zh-ink); }
.zh-day abbr { display: none; text-decoration: none; }
.zh-day-total { font-family: 'Lexend', 'Inter', sans-serif; font-weight: 600; color: var(--zh-faint); font-variant-numeric: tabular-nums; }
.zh-sheet-row.is-filled .zh-day-total { color: var(--zh-ink); }
.zh-sheet-row.has-flag .zh-day-total { color: var(--zh-amber); }
.zh-sheet-row.has-flag .zh-day-total::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: #fdf0e1; color: var(--zh-amber); font-size: .75rem; font-weight: 800; vertical-align: 2px; }
.zh-sheet-row.is-error { background: #fff5f7; }
.zh-sheet-row.is-error .zh-day-total { color: var(--zh-red); font-family: inherit; font-size: .88rem; }
.zh-sheet-row.is-error input { border-color: #f0a9b9; }
.zh-week-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 12px 0 18px; }

.zh-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.zh-sum { padding: 14px 16px; border: 1px solid var(--zh-line); border-radius: 16px; background: #fbfaff; }
.zh-sum p { color: var(--zh-muted); font-size: .78rem; font-weight: 700; }
.zh-sum strong { display: block; margin-top: 2px; font-family: 'Lexend', 'Inter', sans-serif; font-size: 1.55rem; font-weight: 700; color: var(--zh-ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.zh-sum span { color: var(--zh-muted); font-size: .8rem; }
.zh-sum-main { border: 0; color: #fff; background: radial-gradient(260px 140px at 100% 0%, rgba(14, 165, 160, .45), transparent 65%), linear-gradient(150deg, #2a1fa8, #17125e 75%); }
.zh-sum-main p, .zh-sum-main span { color: #c9c5ff; }
.zh-sum-main strong { color: #fff; }
.zh-sum.is-plus { border-color: #b9ecd4; background: #effbf5; }
.zh-sum.is-plus strong { color: var(--zh-green); }
.zh-sum.is-minus { border-color: #f5c4cf; background: #fff5f7; }
.zh-sum.is-minus strong { color: var(--zh-red); }

.zh-checks { display: grid; gap: 6px; margin: 14px 0 0; padding: 14px 16px 14px 40px; border-radius: 14px; background: #fff8ef; border: 1px solid #f6dcbc; color: #7a3a06; font-size: .88rem; line-height: 1.5; }
.zh-checks li::marker { color: var(--zh-amber); }
.zh-week > .zh-error { margin-top: 12px !important; color: var(--zh-red); font-weight: 600; font-size: .9rem; }
.zh-week-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--zh-line); }
.zh-privacy { margin-top: 10px !important; }
.zh-print-head, .zh-print-sign, .zh-print-credit { display: none; }

/* Toast */
.zh-toast { position: fixed; left: 50%; bottom: 24px; z-index: 2000; transform: translateX(-50%); padding: 10px 18px; border-radius: 12px; background: #17125e; color: #fff; font-size: .9rem; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }

/* Wider stage for this tool */
.zus-stage-tool:has(.zh) { max-width: 980px; }

@media (max-width: 860px) {
	.zh-span { grid-template-columns: minmax(0, 1fr); }
	.zh-week-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.zh-tabs { width: 100%; }
	.zh-tab { flex: 1; justify-content: center; padding: 0 10px; }
	.zh-tab small { display: none; }
	.zh-span-form, .zh-week, .zh-result { padding: 16px; border-radius: 18px; }
	.zh-span-fields { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
	.zh-field-pause { grid-column: 1 / -1; margin-left: 0; }
	.zh-tiles dd { font-size: 1rem; }
	.zh-week-meta { gap: 10px; }
	.zh-presets { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
	.zh-presets::-webkit-scrollbar { display: none; }
	.zh-presets .zh-chip { flex-shrink: 0; white-space: nowrap; }
	.zh-chip { flex-shrink: 0; }
	.zh-sheet-head { grid-template-columns: 1fr 1fr .75fr; gap: 8px; padding: 9px 12px; font-size: .68rem; }
	.zh-sheet-head span:first-child, .zh-sheet-head span:last-child { display: none; }
	.zh-sheet-head span { text-align: center; }
	.zh-hide-sm { display: none; }
	.zh-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
	.zh-sum { padding: 12px 13px; border-radius: 14px; }
	.zh-sum strong { font-size: 1.3rem; }
	.zh-sum span { font-size: .74rem; }
	.zh-sheet-row { grid-template-columns: 1fr 1fr .75fr; gap: 6px 8px; padding: 10px 12px; }
	.zh-day { grid-column: 1 / 3; }
	.zh-day abbr { display: none; }
	.zh-day-total { grid-column: 3; grid-row: 1; }
	.zh-sheet-row input[type="text"] { min-height: 44px; padding: 8px 6px; }
	.zh-week-actions > * { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 380px) {
	.zh-span-fields { grid-template-columns: 1fr; }
	.zh-arrow { display: none; }
	.zh-week-meta { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .zh *, .zh { transition: none !important; } }

/* Print: only the Stundenzettel, when printed via our button */
@media print {
	html.zh-printing body * { visibility: hidden !important; }
	html.zh-printing .zh-week, html.zh-printing .zh-week * { visibility: visible !important; }
	html.zh-printing .zh, html.zh-printing .zus-stage, html.zh-printing .zus-stage-tool, html.zh-printing .zh-pane { position: static !important; }
	@page { margin: 14mm; }
	html.zh-printing .zh-summary { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
	html.zh-printing .zh-sheet-row { padding-top: 4px; padding-bottom: 4px; }
	html.zh-printing .zh-sum { padding: 8px 10px; }
	html.zh-printing .zh-sum strong { font-size: 15pt; }
	html.zh-printing .zh-week { position: absolute; left: 0; top: 0; width: 100%; padding: 0; border: 0; box-shadow: none; }
	html.zh-printing .zh-week-meta, html.zh-printing .zh-week-tools, html.zh-printing .zh-week-actions, html.zh-printing .zh-privacy, html.zh-printing .zh-week > .zh-error { display: none !important; }
	html.zh-printing .zh-print-head { display: block; margin-bottom: 14px; }
	html.zh-printing .zh-print-title { font-size: 22pt; font-weight: 800; color: #000; }
	html.zh-printing .zh-print-meta { display: flex; gap: 24px; margin-top: 4px; font-size: 11pt; color: #333; }
	html.zh-printing .zh-sheet-head, html.zh-printing .zh-sheet-row { grid-template-columns: 110px 1fr 1fr .8fr 110px; }
	html.zh-printing .zh-sheet-head { display: grid; background: #f2f2f2 !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	html.zh-printing .zh-sheet-row input { border: 0; min-height: 30px; color: #000; }
	html.zh-printing .zh-sheet-row input::placeholder { color: transparent; }
	html.zh-printing .zh-day-long { display: inline; }
	html.zh-printing .zh-sum { background: #fff !important; border: 1px solid #bbb; color: #000; }
	html.zh-printing .zh-sum strong, html.zh-printing .zh-sum p, html.zh-printing .zh-sum span { color: #000 !important; }
	html.zh-printing .zh-checks { background: #fff; border-color: #bbb; color: #000; }
	html.zh-printing .zh-print-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; font-size: 9pt; color: #333; }
	html.zh-printing .zh-print-sign span { padding-top: 6px; border-top: 1px solid #000; }
	html.zh-printing .zh-print-credit { display: block; margin-top: 28px; font-size: 8pt; color: #777; }
}
