/*
 * Zeitfinder 6.9.103 · Polish details
 * Toasts and undo, the loading outline instead of the spinner card, sheet grabbers, blurred photo
 * placeholders, keyboard hints, safe areas, tap targets, tabular figures, balanced headings and
 * continuous corners. Loaded last, so plain selectors win over the older files where they must;
 * the broad typographic rules use :where() so every component can still set its own.
 */

/* ---------- toasts ---------- */
.zf-toasts {
  position: fixed; z-index: 10000; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: grid; gap: 8px; justify-items: center; width: min(460px, calc(100% - 32px)); transform: translateX(-50%);
  pointer-events: none;
}
body.is-workspace .zf-toasts { bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }
@media (max-width: 860px) {
  body.is-workspace .zf-toasts { bottom: calc(var(--ws-tabbar, 64px) + env(safe-area-inset-bottom, 0px) + 18px); }
}
.zf-toast {
  position: relative; display: flex; align-items: center; gap: 4px; min-height: 48px; max-width: 100%; overflow: hidden;
  padding: 6px 6px 6px 16px; border-radius: 16px; background: #22281c; color: #f6f7f1;
  box-shadow: 0 18px 40px -16px rgba(20, 26, 14, .55); font: 500 14px/1.35 var(--ws-sans, inherit);
  pointer-events: auto; animation: zfToastIn .26s cubic-bezier(.2, .8, .2, 1) both;
}
.zf-toast.is-error { background: #5b2418; }
.zf-toast.is-leaving { animation: zfToastOut .18s ease both; }
.zf-toast-text { flex: 1 1 auto; padding: 6px 6px 6px 0; text-wrap: pretty; }
.zf-toast-action {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 11px;
  background: rgba(255, 255, 255, .1); color: #e7f7a6; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.zf-toast-action:hover, .zf-toast-action:focus-visible { background: rgba(255, 255, 255, .18); }
.zf-toast-action kbd{
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .22);
  font: 600 11px/1 var(--ws-sans, inherit); font-variant-numeric: tabular-nums; color: inherit; opacity: .8;
}
.zf-toast-close {
  display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 11px;
  background: none; color: rgba(255, 255, 255, .7); cursor: pointer;
}
.zf-toast-close:hover, .zf-toast-close:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; }
.zf-toast-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.zf-toast-time {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: #c9ee5a; transform-origin: 0 50%;
  animation: zfToastTime var(--zf-toast-ms, 5000ms) linear both;
}
@keyframes zfToastIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes zfToastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes zfToastTime { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* A row removed with undo folds away; the transition runs back if «Rückgängig» comes mid-way. */
.zf-undo-row { overflow: hidden; transition: height .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, margin .26s ease, padding .26s ease; }
.zf-undo-card { transition: opacity .18s ease, transform .2s cubic-bezier(.2, .8, .2, 1); }
.zf-undo-card.is-gone { opacity: 0; transform: scale(.96); pointer-events: none; }
.zf-undo-row.is-gone { opacity: 0; margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; border-width: 0 !important; pointer-events: none; }

/* ---------- loading outline instead of the spinner card (links that open a page) ---------- */
.loader-skeleton { display: none; }
.global-loader.is-skeleton { place-items: start stretch; background: var(--zf-canvas, #f7f7f5); backdrop-filter: none; -webkit-backdrop-filter: none; }
.global-loader.is-skeleton .loader-card { display: none; }
.global-loader.is-skeleton .loader-skeleton {
  display: grid; gap: 14px; align-content: start; width: min(1120px, calc(100% - 40px)); margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 96px) 0 40px;
}
body.is-workspace .global-loader.is-skeleton { z-index: 60; } /* under the phone app bar and tab bar */
body.is-workspace .global-loader.is-skeleton .loader-skeleton { padding-top: calc(env(safe-area-inset-top, 0px) + 84px); }
.loader-skeleton .zf-sk {
  display: block; height: 14px; border-radius: 8px;
  background: linear-gradient(90deg, #e9ece2 0%, #f7f8f3 45%, #e9ece2 90%); background-size: 220% 100%;
  animation: zfPolishShim 1.2s ease-in-out infinite;
}
.loader-skeleton .is-kick { width: 90px; height: 10px; }
.loader-skeleton .is-title { width: min(360px, 72%); height: 38px; border-radius: 12px; }
.loader-skeleton .is-lead { width: min(480px, 90%); }
.loader-skeleton .is-card { height: 150px; border-radius: 22px; margin-top: 8px; }
.loader-skeleton-rows { display: grid; gap: 10px; }
.loader-skeleton-rows .zf-sk { height: 58px; border-radius: 16px; }
@keyframes zfPolishShim { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* Planner columns while the week loads (public/app.js loadWeek). */
.zf-week-day.is-skeleton .zf-week-day-head .zf-sk { display: block; height: 10px; border-radius: 6px; background: #e9ece2; }
.zf-week-day.is-skeleton .zf-week-day-head .is-day { width: 26px; }
.zf-week-day.is-skeleton .zf-week-day-head .is-date { width: 40px; height: 12px; }
.zf-week-day.is-skeleton .zf-week-day-body { position: relative; }
.zf-week-day.is-skeleton .zf-sk.is-block {
  position: absolute; left: 6px; right: 6px; border-radius: 10px;
  background: linear-gradient(90deg, #edf1e4 0%, #f8faf4 45%, #edf1e4 90%); background-size: 220% 100%; animation: zfPolishShim 1.2s ease-in-out infinite;
}
.zf-week-planner .zf-calendar-loading { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The star answers at once (optimistic); a small pop says «noted». */
.zf-star.is-pop svg { animation: zfStarPop .32s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes zfStarPop { 40% { transform: scale(1.28); } 100% { transform: none; } }

/* ---------- sheets: a grabber says «drag me» ---------- */
@media (max-width: 860px) {
  .zf-ws-newsheet-box { padding-top: calc(var(--ws-4, 16px) + 10px); }
  .zf-ws-newsheet-box::before, .zf-hm::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; border-radius: 99px;
    background: var(--zf-line-strong, #d5d1ca); transform: translateX(-50%);
  }
  .zf-hm { position: relative; padding-top: 22px !important; }
  .zf-ws-newsheet-box, .zf-hm, .zf-dialog-card { touch-action: pan-y; will-change: transform; }
}

/* ---------- photos: blurred placeholder, then the picture ---------- */
.zf-blurup { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 20% 15%, #eef2e3 0%, #dfe5d2 45%, #cfd7c0 100%); min-height: 120px; }
.zf-blurup::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); background-size: 220% 100%;
  animation: zfPolishShim 1.6s ease-in-out infinite; transition: opacity .3s ease;
}
.zf-blurup img { display: block; filter: blur(18px) saturate(1.1); transform: scale(1.06); opacity: .35; transition: filter .55s ease, transform .55s ease, opacity .4s ease; }
.zf-blurup.is-loaded { min-height: 0; }
.zf-blurup.is-loaded::after { opacity: 0; animation: none; }
.zf-blurup.is-loaded img { filter: none; transform: none; opacity: 1; }
.zf-blurup.is-instant img, .zf-blurup.is-instant::after { transition: none; }

/* ---------- keyboard hints in the search palette ---------- */
.zf-ws-pal-foot {
  display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--ws-line, #e5e3de);
  color: var(--ws-ink5, #79756e); font: 500 12px/1.4 var(--ws-sans, inherit);
}
.zf-ws-pal-foot span { display: inline-flex; align-items: center; gap: 5px; }
.zf-ws-pal-foot kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--ws-line, #e5e3de);
  border-bottom-width: 2px; border-radius: 6px; background: #fff; color: var(--ws-ink, #2b2e23); font: 600 11px/1 var(--ws-sans, inherit);
}
@media (hover: none), (max-width: 860px) { .zf-ws-pal-foot { display: none; } }

/* ---------- safe areas (notch, rounded corners and home bar; viewport-fit=cover) ---------- */
@supports (padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  @media (max-width: 860px) {
    body.is-workspace .zf-ws-tabbar { padding-left: max(var(--ws-2, 8px), env(safe-area-inset-left, 0px)); padding-right: max(var(--ws-2, 8px), env(safe-area-inset-right, 0px)); }
    .zf-ws-more, .zf-ws-newsheet-box { padding-left: max(var(--ws-3, 12px), env(safe-area-inset-left, 0px)); padding-right: max(var(--ws-3, 12px), env(safe-area-inset-right, 0px)); }
  }
  .zf-ws-pal { padding-top: env(safe-area-inset-top, 0px); }
}

/* ---------- tap targets: at least 44 × 44 px on touch screens, also where the icon is smaller ---------- */
/* An invisible hit area centred on the control; the drawn icon or text keeps its size. */
@media (pointer: coarse) {
  :where(.zf-slot-delete-trigger, .zf-bt-more-btn, .zf-year-nav, .zf-rc-dots, .zf-star, .zf-iconbtn, .zk-iconbtn, .zk-link, .zf-bt-link,
    .backlink, .zf-ab-cat, .zf-btn, .zf-soon-x, .zf-icon-quiet, .zf-ws-more-close, .icon-button, .zk-more > summary, .zf-mobile-search,
    .zf-mobile-avatar, .zf-mobile-bar-back, .zf752-holo-close, .zf752-holo-lock, .zf-toast-close, .zf-dialog-close) { position: relative; }
  :is(.zf-slot-delete-trigger, .zf-bt-more-btn, .zf-year-nav, .zf-rc-dots, .zf-star, .zf-iconbtn, .zk-iconbtn, .zk-link, .zf-bt-link,
    .backlink, .zf-ab-cat, .zf-btn, .zf-soon-x, .zf-icon-quiet, .zf-ws-more-close, .icon-button, .zk-more > summary, .zf-mobile-search,
    .zf-mobile-avatar, .zf-mobile-bar-back, .zf752-holo-close, .zf752-holo-lock, .zf-toast-close, .zf-dialog-close, .zf-language-trigger)::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
    border-radius: inherit; background: transparent; pointer-events: auto;
  }
}

/* ---------- tabular figures: counters, times and amounts keep their width ---------- */
:where(time, td, th, kbd, .zf-ws-badge, .badge, .pill, .count, .stat-card strong, .stat-card b, .zf-stat strong, .zf-stat b,
  .zf-soon-left, [data-zf-soon-left], .zf-hm-c b, .zf-hm-big b, .zf-hm-date, .zf-version-row strong, .zf-plan-price,
  .price, .amount, .zf-price, .zf-count, .zf-num, .slot-time, .zf-slot-time, .time-chip, .zf-time, [data-count], [data-counter]) {
  font-variant-numeric: tabular-nums;
}
:where(input[type="number"], input[type="time"], input[type="date"], input[inputmode="numeric"], .zf-code-input, .pin-input, .booking-code-input) {
  font-variant-numeric: tabular-nums;
}

/* ---------- headings without a lonely last word ---------- */
:where(h1, h2, h3, h4, legend, .zf-dialog-title, .page-title, .hero-title, .zf-title, .section-title) { text-wrap: balance; }
:where(p, li, dd, figcaption, blockquote, .lead, .zf-lead, small, .hint, .zf-hint) { text-wrap: pretty; }

/* ---------- continuous (squircle) corners where the browser draws them ---------- */
@supports (corner-shape: superellipse(1.5)) {
  :where(.section-card, .card, .panel, .zf-panel, .zf-panel-card, .stat-card, .zf-page-tile, .zf-group-card, .zf-group-join-card,
    .loader-card, .zf-dialog-card, .zf-ws-newsheet-box, .zf-ws-pop, .zf-ws-newpop, .zf-ws-pal-box, .zf-ws-ms, .zf-ws-tile, .zf-ws-mic,
    .zf-hm, .zf-toast, .zf-toast-action, .zf-toast-close, .zf-ws-i, .zf-ws-newrow, .zf-ws-pop-row, .zf-ws-pal-row, .zf-ws-search,
    .zf-ws-create, .zf-sk-list, .zf-week-day, .zf-calendar-card, .booking-card, .zf-booking-card, .alert, .zk-card, .zk-panel,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea,
    .button:not(.button-pill), .zf-btn, .zf-iconbtn, .zf-chip, .zf-language-dialog, .zf-language-grid button) {
    corner-shape: superellipse(1.6);
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .zf-toast, .zf-toast.is-leaving { animation: none; }
  .zf-toast-time { animation: none; transform: scaleX(.35); opacity: .6; }
  .zf-undo-row, .zf-undo-card { transition: none; }
  .loader-skeleton .zf-sk, .zf-week-day.is-skeleton .zf-sk.is-block, .zf-blurup::after, .zf-star.is-pop svg { animation: none; }
  .zf-blurup img { transition: none; }
}

/* ---------- buttons keep their label (6.9.110) ----------
   .button is white-space:nowrap, but the 6.8.1 i18n rule gave it min-width:0, so in a flex row next to
   long copy (e.g. "Institution verwalten" beside the Bonuspakete text) the button was squeezed narrower
   than its label and the text ran over the padding (min-width:auto would not help, buttons are
   overflow:hidden). min-width:min-content keeps a nowrap button at its full label width, while buttons
   that opt into wrapping (white-space:normal) can still shrink, because their min-content stays small.
   Panel heads wrap on phones so the button moves under the text instead of pushing the page wider. */
.button { min-width: min-content; }
@media (max-width: 640px) {
  .zf-panel-head { flex-wrap: wrap; }
}

/* 6.9.159: language picker without flag emojis: the language code in a flat tile; four languages in two columns. */
.zf-language-grid .zf-language-card-flag.is-code { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eef3e2; color: #3a4434; font-size: .68rem; font-weight: 800; letter-spacing: .06em; }
.zf-language-grid form.is-current .zf-language-card-flag.is-code { background: #c4f22c; color: #1c2417; }
.zf-language-grid form button { grid-template-columns: auto 1fr; }
.zf-language-grid.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 520px) { .zf-language-grid.is-four { grid-template-columns: minmax(0, 1fr); } }
