/* HabiVox UI-Bausteine: eigene Dialoge, Auswahllisten, Datum/Zeit, Farbe, Datei, Häkchen – statt Browser-Standard. */
:root { --hv-pop: #fff; --hv-acc: var(--brand, var(--accent, #0f3d2e)); --hv-acc-ink: var(--brand-ink, var(--on-accent, #fff)); --hv-bg: var(--eu-card, var(--card, #fff)); --hv-text: var(--eu-text, var(--text, #0b1f19)); --hv-dim: var(--eu-dim, var(--text-dim, #41504a)); --hv-line: var(--eu-line, var(--border-strong, #c3cfc9)); --hv-soft: color-mix(in srgb, var(--hv-acc) 12%, transparent); --hv-danger: var(--eu-danger, var(--red, #c0262d)); }

.hv-listbox, .hv-pop, .hv-dlg-back { --hv-pop: #ffffff; --hv-bg: #ffffff; --hv-text: #0b1f19; --hv-dim: #41504a; --hv-line: rgba(11,31,25,.18); --hv-soft: color-mix(in srgb, var(--hv-acc) 12%, transparent); }
.hv-listbox.hv-dark, .hv-pop.hv-dark, .hv-dlg-back.hv-dark { --hv-pop: #0b2e23; --hv-bg: #08241b; --hv-text: #f4fbf8; --hv-dim: #c3d3cc; --hv-line: rgba(255,255,255,.22); --hv-soft: color-mix(in srgb, var(--hv-acc) 22%, transparent); }

/* ---- Auswahlfelder: Browser-Pfeil/Popup weg, Pfeil per CSS ---- */
select:not([multiple]):not([data-native]) {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52% !important; background-size: 5px 5px, 5px 5px !important; background-repeat: no-repeat !important;
  padding-inline-end: 34px !important;
}
select:disabled { cursor: not-allowed; }
.hv-listbox { position: fixed; z-index: 100000; max-height: min(320px, 50vh); overflow: auto; padding: 6px; border-radius: 16px; background: var(--hv-pop); color: var(--hv-text); border: 1px solid var(--hv-line); box-shadow: 0 18px 50px rgba(0,0,0,.28); font: inherit; font-size: .9375rem; }
.hv-listbox .hv-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; min-height: 38px; line-height: 1.25; }
.hv-listbox .hv-opt[aria-selected="true"] { font-weight: 700; }
.hv-listbox .hv-opt[aria-selected="true"]::after { content: ""; width: 5px; height: 10px; border: solid var(--hv-acc); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-right: 4px; flex: 0 0 auto; }
.hv-listbox .hv-opt.hv-active { background: var(--hv-soft); }
.hv-listbox .hv-opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.hv-listbox .hv-grp { padding: 8px 12px 4px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hv-dim); }

/* ---- Häkchen / Optionsfelder ---- */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto; display: inline-grid; place-content: center; vertical-align: middle; cursor: pointer;
  width: 20px !important; height: 20px !important; min-height: 20px !important; padding: 0 !important; margin: 0 8px 0 0;
  border: 1.5px solid var(--hv-line) !important; background: var(--hv-bg) !important; border-radius: 6px !important; transition: background .15s, border-color .15s;
}
input[type="radio"] { border-radius: 50% !important; }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--hv-acc) !important; border-color: var(--hv-acc) !important; }
input[type="checkbox"]:checked::after { content: ""; width: 5px; height: 10px; border: solid var(--hv-acc-ink); border-width: 0 2.2px 2.2px 0; transform: translateY(-1px) rotate(45deg); }
input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hv-acc-ink); }
input[type="checkbox"]:indeterminate { background: var(--hv-acc) !important; border-color: var(--hv-acc) !important; }
input[type="checkbox"]:indeterminate::after { content: ""; width: 10px; height: 2px; background: var(--hv-acc-ink); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 3px solid var(--hv-acc); outline-offset: 2px; }

/* ---- Zahlenfelder ohne Browser-Pfeile, Suchfeld ohne Browser-Kreuz, Autofill im Design ---- */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--hv-bg) inset !important; -webkit-text-fill-color: var(--hv-text) !important; caret-color: var(--hv-text); transition: background-color 9999s; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--hv-dim) 55%, transparent) transparent; }

/* ---- Datei ---- */
.hv-file { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hv-file .hv-file-btn { min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--hv-line); background: var(--hv-bg); color: var(--hv-text); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
.hv-file .hv-file-btn:hover { background: var(--hv-soft); }
.hv-file .hv-file-name { font-size: .8125rem; color: var(--hv-dim); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type="file"].hv-file-input { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; opacity: 0; overflow: hidden; pointer-events: none; padding: 0 !important; border: 0 !important; }

/* ---- Datum / Zeit / Farbe ---- */
.hv-dt-wrap { position: relative; display: block; width: 100%; }
.hv-dt-wrap > input.hv-dt-vis { width: 100%; padding-inline-end: 42px; }
.hv-dt-wrap > .hv-dt-ico { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--hv-dim); cursor: pointer; display: grid; place-content: center; padding: 0; }
.hv-dt-wrap > .hv-dt-ico:hover { background: var(--hv-soft); color: var(--hv-text); }
.hv-pop { position: fixed; z-index: 100000; background: var(--hv-pop); color: var(--hv-text); border: 1px solid var(--hv-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.28); padding: 12px; font: inherit; font-size: .9375rem; max-width: calc(100vw - 16px); }
.hv-cal { display: grid; gap: 6px; width: 280px; }
.hv-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.hv-cal-head button, .hv-pop-foot button { border: 0; background: transparent; color: var(--hv-text); border-radius: 999px; min-width: 36px; min-height: 36px; padding: 0 12px; font: inherit; font-weight: 600; cursor: pointer; }
.hv-cal-head button:hover, .hv-pop-foot button:hover { background: var(--hv-soft); }
.hv-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.hv-cal-grid .hv-dow { font-size: .6875rem; font-weight: 700; color: var(--hv-dim); padding: 6px 0; text-transform: uppercase; }
.hv-cal-grid button.hv-day { aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; color: var(--hv-text); font: inherit; font-size: .875rem; cursor: pointer; min-height: 34px; }
.hv-cal-grid button.hv-day:hover { background: var(--hv-soft); }
.hv-cal-grid button.hv-day.hv-out { color: var(--hv-dim); opacity: .55; }
.hv-cal-grid button.hv-day.hv-today { box-shadow: inset 0 0 0 1.5px var(--hv-acc); }
.hv-cal-grid button.hv-day.hv-sel { background: var(--hv-acc); color: var(--hv-acc-ink); font-weight: 700; }
.hv-cal-grid button.hv-day:disabled { opacity: .25; cursor: not-allowed; }
.hv-pop-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.hv-time { display: flex; gap: 8px; margin-top: 8px; }
.hv-time .hv-col { flex: 1; max-height: 196px; overflow: auto; border: 1px solid var(--hv-line); border-radius: 12px; padding: 4px; }
.hv-time .hv-col button { display: block; width: 100%; border: 0; background: transparent; color: var(--hv-text); border-radius: 8px; padding: 7px 0; font: inherit; font-size: .875rem; cursor: pointer; }
.hv-time .hv-col button:hover { background: var(--hv-soft); }
.hv-time .hv-col button.hv-sel { background: var(--hv-acc); color: var(--hv-acc-ink); font-weight: 700; }
.hv-dt-split { display: flex; gap: 12px; align-items: flex-start; }
@media (max-width: 560px) { .hv-dt-split { flex-direction: column; } .hv-cal { width: 100%; } }
.hv-color-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 14px 6px 8px; border-radius: 999px; border: 1px solid var(--hv-line); background: var(--hv-bg); color: var(--hv-text); font: inherit; font-size: .875rem; cursor: pointer; }
.hv-color-btn i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); display: block; }
.hv-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; width: 288px; max-width: 100%; }
.hv-swatches button { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.hv-swatches button.hv-sel, .hv-swatches button:hover { border-color: var(--hv-text); }
.hv-hexrow { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.hv-hexrow input { flex: 1; min-width: 0; border-radius: 12px; border: 1px solid var(--hv-line); background: var(--hv-bg); color: var(--hv-text); padding: 8px 12px; font: inherit; font-family: ui-monospace, Consolas, monospace; min-height: 40px; }

/* ---- Dialoge (statt alert/confirm/prompt) ---- */
.hv-dlg-back { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(4, 21, 15, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hv-dlg { width: min(440px, 100%); background: var(--hv-pop); color: var(--hv-text); border: 1px solid var(--hv-line); border-radius: 24px; padding: 24px; box-shadow: 0 30px 90px -20px rgba(0,0,0,.5); font: inherit; }
.hv-dlg h2 { margin: 0 0 10px; font-size: 1.125rem; letter-spacing: -.02em; }
.hv-dlg p { margin: 0; white-space: pre-line; line-height: 1.5; color: var(--hv-text); font-size: .9375rem; }
.hv-dlg input[type="text"], .hv-dlg input[type="password"] { width: 100%; margin-top: 14px; min-height: 46px; border-radius: 14px; border: 1px solid var(--hv-line); background: var(--hv-bg); color: var(--hv-text); padding: 0 14px; font: inherit; }
.hv-dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hv-dlg-actions button { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--hv-line); background: transparent; color: var(--hv-text); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.hv-dlg-actions button.hv-ok { background: var(--hv-acc); border-color: var(--hv-acc); color: var(--hv-acc-ink); }
.hv-dlg-actions button.hv-danger { background: var(--hv-danger); border-color: var(--hv-danger); color: #fff; }
.hv-dlg button:focus-visible, .hv-dlg input:focus-visible { outline: 3px solid var(--hv-acc); outline-offset: 2px; }

/* Seiten-CSS (z. B. admin-studio: button { border-radius !important }) darf die Form der Bausteine nicht überschreiben */
.hv-cal-grid button.hv-day { border-radius: 50% !important; }
.hv-cal-head button, .hv-pop-foot button, .hv-file .hv-file-btn, .hv-dlg-actions button, .hv-color-btn, .hv-dt-wrap > .hv-dt-ico { border-radius: 999px !important; }
.hv-time .hv-col button { border-radius: 8px !important; }
.hv-swatches button { border-radius: 50% !important; }
.hv-dt-wrap > .hv-dt-ico { border-radius: 10px !important; }
