/* ==========================================================================
   03 — Components · MOBILE FIRST
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons — tap targets first
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--c-blue);
  --btn-fg: #fff;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; min-height: 50px;
  border: 0; border-radius: var(--r-sm);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: var(--fs-sm); line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform var(--t-fast) var(--e-spring),
              box-shadow var(--t-base) var(--e-out),
              background-color var(--t-fast) var(--e-out),
              color var(--t-fast) var(--e-out),
              opacity var(--t-fast) linear;
}
.btn:active { transform: scale(.975); box-shadow: none; transition-duration: 60ms; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}

.btn--primary:active { background: var(--c-blue-700); }

.btn--secondary { --btn-bg: var(--c-tint-2); --btn-fg: var(--c-blue); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--c-navy-2);
  box-shadow: inset 0 0 0 1.5px var(--c-line);
}
.btn--ghostblue { --btn-bg: var(--c-tint); --btn-fg: var(--c-blue); }
.btn--light { --btn-bg: #fff; --btn-fg: var(--c-navy-2); }

.btn--icon { padding: 14px; min-width: 50px; }
.btn--lg  { min-height: 54px; padding: 16px 28px; font-size: 1rem; }
.btn--sm  { min-height: 40px; padding: 8px 16px; font-size: var(--fs-xs); }
.btn--block { width: 100%; }
/* Auf dem Telefon soll die Hauptaktion die volle Breite bekommen. */
.btn--blockmobile { width: 100%; }

.btn__arrow { transition: transform var(--t-base) var(--e-spring); flex: none; }
.btn__arrow--back { transition: transform var(--t-base) var(--e-spring); }

/* Ladezustand */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn--secondary.is-loading::after,
.btn--ghost.is-loading::after,
.btn--ghostblue.is-loading::after,
.btn--light.is-loading::after {
  border-color: rgba(0, 102, 179, .3); border-top-color: var(--c-blue);
}

.btn--link {
  background: none; border: 0; padding: 6px 2px; min-height: 0;
  color: var(--c-blue); font-weight: 600; font-size: var(--fs-sm);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.btn--link:active { color: var(--c-blue-700); }

/* Pointer devices additionally get hover feedback. -------------------------- */
@media (hover: hover) and (pointer: fine) {
  .btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 102, 179, .26); }
  .btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform var(--t-slow) var(--e-out);
  }
  .btn:hover::before { transform: translateX(120%); }
  .btn--primary:hover { background: var(--c-blue-600); }
  .btn--secondary:hover { background: var(--c-tint-3); box-shadow: 0 8px 20px rgba(0, 32, 71, .10); }
  .btn--ghost:hover { background: var(--c-surface); box-shadow: inset 0 0 0 1.5px var(--c-blue), 0 8px 20px rgba(0,32,71,.08); color: var(--c-blue); }
  .btn--ghostblue:hover { background: var(--c-tint-3); }
  .btn--light:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
  .btn:hover .btn__arrow { transform: translateX(5px); }
  .btn:hover .btn__arrow--back { transform: translateX(-5px); }
  .btn--link:hover { color: var(--c-blue-700); transform: none; box-shadow: none; }
  .btn--link::before { display: none; }
}

@media (min-width: 768px) {
  .btn { min-height: 48px; padding: 13px 26px; }
  .btn--icon { padding: 13px; min-width: 48px; }
  .btn--lg { min-height: 56px; padding: 16px 34px; }
  .btn--blockmobile { width: auto; }
}

/* --------------------------------------------------------------------------
   Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}
.card--pad { padding: 20px; }

.card__foot {
  border-top: 1px solid var(--c-line-soft);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card__foot--split { justify-content: space-between; }

/* Sticky action bar: the main action stays within thumb reach without
   scrolling to the end of a long form. `sticky` rather than `fixed`, so the
   screen transitions (which use transform) cannot tear it loose. */
.card__foot--sticky {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--c-surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding-bottom: calc(16px + var(--safe-b));
  flex-wrap: nowrap;
  transition: box-shadow var(--t-base) var(--e-out);
}
.card__foot--sticky.is-stuck { box-shadow: var(--sh-up); }
.card__foot--sticky .btn { flex: 1 1 auto; }
.card__foot--sticky .btn--icon { flex: 0 0 auto; }

@media (min-width: 768px) {
  .card--pad { padding: clamp(24px, 1rem + 2vw, 44px); }
  .card__foot { padding: 20px clamp(24px, 1rem + 2vw, 44px); }
  .card__foot--sticky {
    position: static; box-shadow: none !important;
    padding-bottom: 20px; flex-wrap: wrap;
  }
  .card__foot--sticky .btn { flex: 0 0 auto; }
}

/* --------------------------------------------------------------------------
   Chips / badges
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 500; line-height: 1.45;
  white-space: nowrap;
  background: var(--c-grey-chip-bg); color: var(--c-grey-chip);
}
.chip svg { width: 14px; height: 14px; flex: none; }
.chip--green  { background: var(--c-green-bg);    color: var(--c-green); }
.chip--blue   { background: var(--c-chipblue-bg); color: var(--c-chipblue); }
.chip--amber  { background: var(--c-amber-bg);    color: var(--c-amber); }
.chip--grey   { background: var(--c-grey-chip-bg); color: var(--c-grey-chip); }

.eyebrow {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--c-hint);
}

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */
.field { position: relative; }
.field + .field { margin-top: 14px; }

.field__box {
  position: relative; min-height: 60px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-sm);
  background: #fff;
  transition: border-color var(--t-fast) var(--e-out),
              box-shadow var(--t-fast) var(--e-out);
}
.field__box:focus-within { border-color: var(--c-blue); box-shadow: var(--sh-focus); }

.field__label {
  position: absolute; left: 15px; top: 17px;
  font-size: var(--fs-body); line-height: 1.6; color: var(--c-hint);
  pointer-events: none; transform-origin: left top;
  max-width: calc(100% - 56px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: transform var(--t-base) var(--e-out), color var(--t-base) var(--e-out);
}
.field__box:focus-within .field__label,
.field.is-filled .field__label {
  transform: translateY(-13px) scale(.72);
  color: var(--c-muted);
}
.field__box:focus-within .field__label { color: var(--c-blue); }

.field__input {
  display: block; width: 100%;
  padding: 26px 15px 8px;
  border: 0; background: none; border-radius: var(--r-sm);
  color: var(--c-ink);
  appearance: none;
}
.field__input::placeholder { color: transparent; }
.field--haspost .field__input { padding-right: 52px; }

.field__post, .field__pre {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
}
.field__post { right: 4px; }
.field__pre  { left: 14px; top: calc(50% + 8px); color: var(--c-green-check); }
button.field__post {
  width: var(--tap); height: var(--tap); border: 0; background: none; cursor: pointer;
  color: var(--c-muted); border-radius: 50%;
  display: grid; place-items: center;
  transition: background var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out);
}
button.field__post:active { background: var(--c-tint); color: var(--c-blue); }

.field__hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--c-hint); }
.field__error {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 7px; font-size: var(--fs-xs); color: var(--c-danger); font-weight: 500;
  animation: slideDownFade var(--t-base) var(--e-out) both;
}
.field__error svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.field.is-invalid .field__box { border-color: var(--c-danger); }
.field.is-invalid .field__box:focus-within { box-shadow: 0 0 0 3px rgba(193, 25, 67, .22); }
.field.is-valid   .field__box { border-color: #9ED2B9; }

/* Select ------------------------------------------------------------------- */
.field__select {
  display: block; width: 100%;
  padding: 26px 44px 8px 15px;
  border: 0; background: none; border-radius: var(--r-sm);
  color: var(--c-ink);
  appearance: none; cursor: pointer;
}
.field__select.has-pre { padding-left: 44px; }
.field__caret {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--c-blue); pointer-events: none;
  transition: transform var(--t-base) var(--e-out);
}
.field__box:focus-within .field__caret { transform: translateY(-50%) rotate(180deg); }

@media (hover: hover) and (pointer: fine) {
  .field__box:hover { border-color: #B9C2CC; }
  button.field__post:hover { background: var(--c-tint); color: var(--c-blue); }
}
@media (min-width: 768px) {
  .field__box { min-height: 64px; }
  .field__label { left: 17px; top: 19px; }
  .field__input { padding: 28px 17px 10px; }
  .field--haspost .field__input { padding-right: 54px; }
  .field__select { padding: 28px 46px 10px 17px; }
  .field__select.has-pre { padding-left: 46px; }
  .field__pre { left: 15px; }
  .field__post { right: 8px; }
  button.field__post { width: 40px; height: 40px; }
}

/* Combobox (searchable select) --------------------------------------------- */
.combo { position: relative; }
.combo__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: var(--z-dropdown);
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); max-height: 52vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  transform-origin: top center;
  animation: popIn var(--t-base) var(--e-out) both;
}
.combo__opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; min-height: var(--tap);
  border: 0; background: none; cursor: pointer;
  border-radius: var(--r-sm); text-align: left; font-size: var(--fs-sm);
  color: var(--c-ink); line-height: 1.35;
  transition: background var(--t-fast) linear;
}
.combo__opt:active, .combo__opt.is-active { background: var(--c-tint); }
.combo__opt[aria-selected="true"] { font-weight: 600; color: var(--c-blue); }
.combo__opt mark { background: #FFF0BF; color: inherit; border-radius: 2px; padding: 0 1px; }
.combo__badge {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-xs);
  display: grid; place-items: center; background: var(--c-tint);
  color: var(--c-blue-600); font-weight: 700; font-size: .6875rem;
}
.combo__empty { padding: 18px 12px; text-align: center; color: var(--c-hint); font-size: var(--fs-sm); }
@media (hover: hover) and (pointer: fine) { .combo__opt:hover { background: var(--c-tint); } }

/* Checkbox ----------------------------------------------------------------- */
.check {
  display: flex; align-items: flex-start; gap: 14px;
  cursor: pointer; position: relative;
  padding: 8px 0; min-height: var(--tap);
  -webkit-tap-highlight-color: transparent;
}
.check__input {
  position: absolute; opacity: 0; width: 28px; height: 28px; margin: 0; cursor: pointer;
}
.check__box {
  position: relative; flex: none;
  width: 26px; height: 26px; margin-top: 1px;
  border: 2px solid var(--c-line); border-radius: var(--r-xs);
  background: #fff;
  display: grid; place-items: center;
  transition: background var(--t-fast) var(--e-out),
              border-color var(--t-fast) var(--e-out),
              transform var(--t-fast) var(--e-spring);
}
.check:active .check__box { transform: scale(.9); }
.check__box svg {
  width: 17px; height: 17px; color: #fff;
  stroke-dasharray: 24; stroke-dashoffset: 24;
  transition: stroke-dashoffset var(--t-base) var(--e-out) 40ms;
}
.check__input:checked + .check__box,
.check__input:indeterminate + .check__box {
  background: var(--c-navy); border-color: var(--c-navy);
}
.check__input:checked + .check__box svg { stroke-dashoffset: 0; }
.check__input:checked + .check__box { animation: checkPop var(--t-base) var(--e-spring); }
.check__input:focus-visible + .check__box { box-shadow: var(--sh-focus); }
.check__input:indeterminate + .check__box::after {
  content: ""; width: 12px; height: 2.5px; border-radius: 2px; background: #fff; position: absolute;
}
.check__input:indeterminate + .check__box svg { opacity: 0; }
.check__text { font-size: var(--fs-sm); line-height: 1.55; color: var(--c-ink); }
.check__text .muted { color: var(--c-muted); }
.check.is-invalid .check__box { border-color: var(--c-danger); }
.check__input:disabled + .check__box { background: var(--c-hint); border-color: var(--c-hint); }
.check__input:disabled ~ .check__text { color: var(--c-muted); }
.check:has(.check__input:disabled) { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .check:hover .check__box { border-color: var(--c-blue); }
  .check:has(.check__input:disabled):hover .check__box { border-color: var(--c-hint); }
}

/* --------------------------------------------------------------------------
   Notices and callouts
   -------------------------------------------------------------------------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--c-tint); color: var(--c-ink);
  font-size: var(--fs-sm); line-height: 1.5;
}
.notice svg { width: 22px; height: 22px; flex: none; color: var(--c-navy); margin-top: 1px; }
.notice--tight { padding: 12px 14px; font-size: var(--fs-xs); }
.notice--amber { background: var(--c-amber-bg); }
.notice--amber svg { color: var(--c-amber); }
.notice--green { background: var(--c-green-bg); }
.notice--green svg { color: var(--c-green); }

.callout {
  border: 1.5px solid var(--c-tint-3); background: #fff;
  border-radius: var(--r-md); padding: 16px 18px;
  font-size: var(--fs-xs); line-height: 1.55; color: var(--c-ink-2);
}

/* --------------------------------------------------------------------------
   Stepper
   -------------------------------------------------------------------------- */
.stepper { --dot: 15px; margin: 0 auto 8px; max-width: 560px; }
.stepper__labels {
  display: grid; grid-template-columns: repeat(3, 1fr);
  font-size: var(--fs-xs); color: var(--c-hint); text-align: center; margin-bottom: 10px;
  gap: 4px;
}
.stepper__labels span { transition: color var(--t-base) var(--e-out); line-height: 1.25; }
.stepper__labels span.is-current { color: var(--c-blue); font-weight: 600; }
.stepper__labels span.is-done { color: var(--c-navy-2); }
.stepper__track {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  align-items: center; height: var(--dot);
}
.stepper__line {
  position: absolute; left: 16.66%; right: 16.66%; height: 3px; top: 50%;
  transform: translateY(-50%); background: #BEDCF0; border-radius: 3px; overflow: hidden;
}
.stepper__line::after {
  content: ""; position: absolute; inset: 0; transform-origin: left;
  background: var(--c-navy); transform: scaleX(var(--fill, 0));
  transition: transform var(--t-xslow) var(--e-out);
}
.stepper__dot {
  position: relative; justify-self: center;
  width: var(--dot); height: var(--dot); border-radius: 50%;
  background: #BEDCF0; display: grid; place-items: center; color: #fff;
  transition: background var(--t-base) var(--e-out), transform var(--t-base) var(--e-spring);
}
.stepper__dot svg { width: 10px; height: 10px; opacity: 0; transition: opacity var(--t-fast) linear; }
.stepper__dot.is-done { background: var(--c-navy); }
.stepper__dot.is-done svg { opacity: 1; }
.stepper__dot.is-current { background: var(--c-navy); transform: scale(1.12); }
.stepper__dot.is-current::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff;
}
@media (min-width: 480px) {
  .stepper { --dot: 17px; }
  .stepper__labels { font-size: var(--fs-sm); margin-bottom: 12px; }
  .stepper__dot svg { width: 11px; height: 11px; }
  .stepper__dot.is-current::after { inset: 4.5px; }
}

/* --------------------------------------------------------------------------
   Progress & loading indicators
   -------------------------------------------------------------------------- */
.progress {
  height: 8px; border-radius: var(--r-pill); background: var(--c-tint);
  overflow: hidden;
}
.progress__bar {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--c-blue) 0%, #29A0E0 100%);
  transition: width var(--t-slow) var(--e-out);
}
.progress__bar::after {
  content: ""; display: block; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shimmer 1.6s linear infinite;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--c-tint-3); border-top-color: var(--c-blue);
  animation: spin .7s linear infinite;
}

/* --------------------------------------------------------------------------
   Menu — an action sheet from the bottom on phones, a popover elsewhere
   -------------------------------------------------------------------------- */
.menu {
  position: absolute; z-index: var(--z-dropdown); min-width: 224px;
  background: #fff; border-radius: var(--r-md); padding: 6px;
  box-shadow: var(--sh-lg); border: 1px solid var(--c-line-soft);
  transform-origin: top right;
  animation: popIn var(--t-base) var(--e-out) both;
}
.menu--right { right: 0; top: calc(100% + 10px); }
.menu__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--c-line-soft); margin-bottom: 6px; }
.menu__name { font-weight: 700; color: var(--c-navy-2); font-size: var(--fs-sm); }
.menu__mail { font-size: var(--fs-xs); color: var(--c-muted); word-break: break-all; }
.menu__item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; min-height: var(--tap);
  border: 0; background: none; cursor: pointer;
  border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--c-ink);
  text-align: left; text-decoration: none;
  transition: background var(--t-fast) linear, color var(--t-fast) linear;
}
.menu__item:active { background: var(--c-tint); color: var(--c-blue); }
.menu__item svg { width: 19px; height: 19px; flex: none; color: var(--c-muted); }
.menu__item--danger:active { background: var(--c-danger-bg); color: var(--c-danger); }
.menu__sep { height: 1px; background: var(--c-line-soft); margin: 6px 4px; }
@media (hover: hover) and (pointer: fine) {
  .menu__item:hover { background: var(--c-tint); color: var(--c-blue); }
  .menu__item:hover svg { color: var(--c-blue); }
  .menu__item--danger:hover { background: var(--c-danger-bg); color: var(--c-danger); }
  .menu__item--danger:hover svg { color: var(--c-danger); }
}

/* Action sheet (mobile) ----------------------------------------------------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-modal);
  background: #fff;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 12px calc(12px + var(--safe-b));
  box-shadow: 0 -12px 40px rgba(0, 32, 71, .22);
  max-height: 80vh; overflow-y: auto;
  animation: sheetIn var(--t-slow) var(--e-out) both;
}
.sheet__grip {
  width: 42px; height: 4px; border-radius: 4px; background: var(--c-line);
  margin: 6px auto 12px;
}
.sheet .menu__item { font-size: 1rem; padding: 15px 14px; }
.sheet .menu__head { padding: 4px 14px 14px; }
.sheet__cancel {
  width: 100%; margin-top: 8px; padding: 15px; min-height: var(--tap);
  border: 0; border-radius: var(--r-sm); background: var(--c-grey-100);
  font-weight: 700; font-size: 1rem; color: var(--c-ink); cursor: pointer;
}
.sheet__cancel:active { background: var(--c-line); }

/* --------------------------------------------------------------------------
   Modal — a sheet from the bottom on phones, a centred dialog from md up
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(0, 20, 44, .5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn var(--t-base) var(--e-out) both;
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay.is-closing { animation: fadeOut var(--t-fast) var(--e-out) both; }
.modal {
  position: relative; z-index: var(--z-modal);
  width: 100%;
  background: #fff;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-xl);
  padding: 24px 20px calc(24px + var(--safe-b));
  animation: sheetIn var(--t-slow) var(--e-out) both;
  max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.overlay.is-closing .modal { animation: sheetOut var(--t-fast) var(--e-out) both; }
.modal::before {
  content: ""; display: block;
  width: 42px; height: 4px; border-radius: 4px; background: var(--c-line);
  margin: -8px auto 16px;
}
.modal__close {
  position: absolute; top: 12px; right: 10px;
  width: var(--tap); height: var(--tap); border: 0; background: none; cursor: pointer;
  border-radius: 50%; display: grid; place-items: center; color: var(--c-muted);
  transition: background var(--t-fast) linear, transform var(--t-fast) var(--e-spring);
}
.modal__close:active { background: var(--c-grey-100); }
.modal__title { margin-bottom: 10px; padding-right: 44px; }
.modal__foot { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 24px; }
.modal__foot .btn { width: 100%; }

@media (min-width: 768px) {
  .overlay { align-items: center; padding: 20px; overflow-y: auto; }
  .modal {
    width: min(560px, 100%);
    border-radius: var(--r-lg);
    padding: 30px;
    max-height: calc(100vh - 40px);
    animation: modalIn var(--t-slow) var(--e-spring) both;
  }
  .overlay.is-closing .modal { animation: modalOut var(--t-fast) var(--e-out) both; }
  .modal::before { display: none; }
  .modal--wide { width: min(760px, 100%); }
  .modal__close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .modal__close:hover { background: var(--c-grey-100); color: var(--c-ink); transform: rotate(90deg); }
  .modal__foot { flex-direction: row; justify-content: flex-end; gap: 12px; margin-top: 26px; }
  .modal__foot .btn { width: auto; }
}

/* --------------------------------------------------------------------------
   Toasts — above the tab bar, so they never cover it
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed; z-index: var(--z-toast);
  left: 12px; right: 12px;
  bottom: calc(12px + var(--safe-b));
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
/* Above the tab bar, so nothing gets covered. */
body.has-tabbar   .toasts { bottom: calc(12px + var(--tabbar-h) + var(--safe-b)); }
body.has-actionbar .toasts { bottom: calc(12px + var(--actionbar-h) + var(--safe-b)); }
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--c-navy); color: #fff; box-shadow: var(--sh-lg);
  font-size: var(--fs-sm); line-height: 1.45;
  animation: toastUp var(--t-slow) var(--e-spring) both;
}
.toast.is-out { animation: toastOut var(--t-base) var(--e-out) both; }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast--success svg { color: #6EE7A8; }
.toast--info    svg { color: #8FD0F5; }
.toast--warn    svg { color: #FFCF7A; }
.toast__close {
  margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.65);
  cursor: pointer; padding: 0 4px; line-height: 1; font-size: 1.2rem;
}
.toast__close:active { color: #fff; }
@media (min-width: 768px) {
  .toasts { left: auto; right: 20px; bottom: 20px; max-width: 400px; }
  .toast { animation-name: toastIn; }
  .toast__close:hover { color: #fff; }
}

/* --------------------------------------------------------------------------
   Tooltip
   -------------------------------------------------------------------------- */
.tip { position: relative; display: inline-flex; }
.tip__bubble {
  position: absolute; bottom: calc(100% + 10px); right: -6px; z-index: var(--z-dropdown);
  width: max-content; max-width: min(268px, 72vw);
  background: var(--c-navy); color: #fff; font-size: var(--fs-xs); line-height: 1.5;
  padding: 11px 13px; border-radius: var(--r-sm); box-shadow: var(--sh-md);
  opacity: 0; transform: translateY(6px) scale(.97); pointer-events: none;
  transition: opacity var(--t-base) var(--e-out), transform var(--t-base) var(--e-spring);
}
.tip__bubble::after {
  content: ""; position: absolute; top: 100%; right: 14px;
  border: 6px solid transparent; border-top-color: var(--c-navy);
}
.tip:hover .tip__bubble,
.tip:focus-within .tip__bubble,
.tip.is-open .tip__bubble { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Developer / demo bar
   -------------------------------------------------------------------------- */
.devbar {
  /* Pushed to the edge on phones — that is where it covers least. */
  position: fixed; right: 12px; z-index: var(--z-devbar);
  bottom: calc(10px + var(--safe-b));
  display: flex; align-items: center; gap: 4px;
  background: rgba(0, 32, 71, .93); color: #fff;
  border-radius: var(--r-pill); padding: 5px;
  box-shadow: var(--sh-lg); font-size: var(--fs-xs);
  backdrop-filter: blur(8px);
  max-width: calc(100vw - 24px);
  transition: transform var(--t-slow) var(--e-spring), opacity var(--t-base) linear;
}
body.has-tabbar   .devbar { bottom: calc(10px + var(--tabbar-h) + var(--safe-b)); }
body.has-actionbar .devbar { bottom: calc(10px + var(--actionbar-h) + var(--safe-b)); }
.devbar.is-hidden { transform: translateY(220%); opacity: 0; }
/* While a sheet or dialog is open, the demo bar steps aside. */
body.is-locked .devbar { opacity: 0; pointer-events: none; }
.devbar__label { opacity: .68; letter-spacing: .04em; margin: 0 6px 0 10px; white-space: nowrap; }
.devbar__btn {
  border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  border-radius: var(--r-pill); padding: 8px 13px; font-size: var(--fs-xs); font-weight: 600;
  transition: background var(--t-fast) linear, transform var(--t-fast) var(--e-spring);
  white-space: nowrap;
}
.devbar__btn:active { background: rgba(255, 255, 255, .3); transform: scale(.95); }
.devbar__x {
  border: 0; background: none; color: rgba(255,255,255,.6); cursor: pointer;
  padding: 6px 10px; font-size: 1rem; line-height: 1;
}
/* Auf dem Telefon startet die Leiste eingeklappt als kleine Pille. */
/* Collapsed: a small, unobtrusive tools button. */
.devbar__toggle {
  border: 0; background: none; color: #fff; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; padding: 0;
}
.devbar:not(.is-open) { padding: 0; opacity: .62; }
.devbar:not(.is-open):active,
.devbar:not(.is-open):focus-within { opacity: 1; }
.devbar__body { display: none; align-items: center; gap: 4px; }
.devbar.is-open .devbar__body { display: flex; }
.devbar.is-open .devbar__toggle { display: none; }

@media (hover: hover) and (pointer: fine) {
  .devbar__btn:hover { background: rgba(255, 255, 255, .26); transform: translateY(-1px); }
  .devbar__x:hover { color: #fff; }
}
@media (min-width: 768px) {
  .devbar {
    bottom: 18px; padding: 5px 6px 5px 4px;
    left: 50%; right: auto; transform: translateX(-50%);
  }
  .devbar.is-hidden { transform: translateX(-50%) translateY(220%); }
  .devbar__body { display: flex; }
  .devbar__toggle { display: none; }
  .devbar.is-open .devbar__toggle { display: none; }
}
@media (max-width: 400px) { .devbar__label { display: none; } }
