@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-fade-out 220ms ease both;
}

::view-transition-new(root) {
  animation: page-fade-in 220ms ease both;
}

@keyframes page-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

:root {
  --utility-rail-width: 42px;
  --utility-gap: 10px;
  --page-edge: 12px;
  --rail-top: 58px;
  --rail-bottom: 50px;
  --shared-rail-bg: #1f1f1f;
  --shared-rail-panel: #2c2c2c;
  --shared-rail-ring: #ffffff22;
}

:root[data-theme="light"] {
  --shared-rail-bg: #f4f5f7;
  --shared-rail-panel: #ffffff;
  --shared-rail-ring: #00000018;
}

/* Enige bron van waarheid voor de utility-rail op alle pagina's. */
.utility-rail {
  position: fixed !important;
  top: 58px !important;
  right: auto !important;
  bottom: 50px !important;
  left: 12px !important;
  z-index: 100;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: auto !important;
  margin: 0 !important;
  box-sizing: border-box;
  padding: 6px 3px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px !important;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  border: 1px solid var(--shared-rail-ring);
  border-radius: 12px;
  background: color-mix(in srgb, var(--shared-rail-panel) 90%, var(--shared-rail-bg));
  box-shadow: 0 5px 16px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
  transform: none !important;
  scale: 1 !important;
  zoom: 1 !important;
}

.utility-rail::-webkit-scrollbar { display: none; }

.rail-button {
  position: relative;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  flex: 0 0 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4285f4;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  transform-origin: center;
  transition: background .15s ease, transform .15s ease;
}

.rail-button:hover,
.rail-button:focus-visible {
  background: color-mix(in srgb, #4285f4 12%, transparent);
  outline: none;
}

.rail-button:active { transform: scale(.94); }
.rail-button.rail-theme { color: #fbbc05; }
.rail-button.rail-theme:hover,
.rail-button.rail-theme:focus-visible { background: color-mix(in srgb, #fbbc05 14%, transparent); }

.rail-separator {
  width: 24px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 2px 0 !important;
  flex: 0 0 1px !important;
  background: var(--shared-rail-ring);
}

.rail-icon {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  display: block;
  flex: 0 0 18px !important;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: none !important;
}

.icon-theme,
.icon-edit,
.icon-home {
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

:root[data-theme="dark"] .icon-theme {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.4 15.2A8.2 8.2 0 0 1 8.8 3.6 9 9 0 1 0 20.4 15.2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.4 15.2A8.2 8.2 0 0 1 8.8 3.6 9 9 0 1 0 20.4 15.2Z'/%3E%3C/svg%3E");
}

:root[data-theme="light"] .icon-theme {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3Cpath fill='black' d='M11 1h2v4h-2zM11 19h2v4h-2zM1 11h4v2H1zM19 11h4v2h-4zM3.5 5l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 17.7l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 6.3l2.8-2.8L20.5 5l-2.8 2.8zM3.5 19l2.8-2.8 1.4 1.4-2.8 2.8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3Cpath fill='black' d='M11 1h2v4h-2zM11 19h2v4h-2zM1 11h4v2H1zM19 11h4v2h-4zM3.5 5l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 17.7l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 6.3l2.8-2.8L20.5 5l-2.8 2.8zM3.5 19l2.8-2.8 1.4 1.4-2.8 2.8z'/%3E%3C/svg%3E");
}

.icon-edit {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m4 17.25-.75 3.5 3.5-.75L18.8 7.95l-2.75-2.75L4 17.25Zm14.3-14.3 2.75 2.75-1.45 1.45-2.75-2.75 1.45-1.45Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m4 17.25-.75 3.5 3.5-.75L18.8 7.95l-2.75-2.75L4 17.25Zm14.3-14.3 2.75 2.75-1.45 1.45-2.75-2.75 1.45-1.45Z'/%3E%3C/svg%3E");
}

.icon-home {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3 2.5 11h2.3v9h5v-6h4.4v6h5v-9h2.3L12 3Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3 2.5 11h2.3v9h5v-6h4.4v6h5v-9h2.3L12 3Z'/%3E%3C/svg%3E");
}

.icon-lotus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M12 3c-2.2 2.5-3.3 4.8-3.3 6.8 0 1.8 1.1 3.3 3.3 4.6 2.2-1.3 3.3-2.8 3.3-4.6C15.3 7.8 14.2 5.5 12 3Z'/%3E%3Cpath fill='%23EA4335' d='M5.2 7.1c-.1 3.9 1.4 6.6 4.5 8.2-3.4.7-5.9-.7-7.4-4.1.3-1.9 1.3-3.3 2.9-4.1Z'/%3E%3Cpath fill='%2334A853' d='M18.8 7.1c.1 3.9-1.4 6.6-4.5 8.2 3.4.7 5.9-.7 7.4-4.1-.3-1.9-1.3-3.3-2.9-4.1Z'/%3E%3Cpath fill='%23FBBC05' d='M7 14.6c1.5 1.5 3.1 2.3 5 2.3s3.5-.8 5-2.3c-.8 3.6-2.5 5.4-5 5.4s-4.2-1.8-5-5.4Z'/%3E%3C/svg%3E");
}

.icon-chatgpt { background-image: url("https://cdn.simpleicons.org/openai/4285F4"); }
.icon-mail { background-image: url("https://cdn.simpleicons.org/gmail/4285F4"); }
.icon-calendar { background-image: url("https://cdn.simpleicons.org/googlecalendar/4285F4"); }
.icon-drive { background-image: url("https://cdn.simpleicons.org/googledrive/4285F4"); }
.icon-photos { background-image: url("https://cdn.simpleicons.org/googlephotos/4285F4"); }
.icon-map { background-image: url("https://cdn.simpleicons.org/googlemaps/4285F4"); }
.icon-whatsapp { background-image: url("https://cdn.simpleicons.org/whatsapp/34A853"); }

.icon-key,
.icon-bank,
.icon-market {
  filter: brightness(0) saturate(100%) invert(48%) sepia(91%) saturate(1890%) hue-rotate(202deg) brightness(99%) contrast(93%);
}
.icon-key { background-image: url("https://www.google.com/s2/favicons?domain=passwords.google.com&sz=64"); }
.icon-bank { background-image: url("https://www.google.com/s2/favicons?domain=rabobank.nl&sz=64"); }
.icon-market { background-image: url("https://www.google.com/s2/favicons?domain=marktplaats.nl&sz=64"); }

:root[data-theme="light"] .utility-rail {
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 16px rgba(31, 41, 51, .08);
}

@media (max-width: 760px) {
  .utility-rail {
    top: auto !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 3px 4px !important;
    flex-direction: row;
    justify-content: space-between;
    gap: 0 !important;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .rail-button {
    width: 30px !important;
    min-width: 0 !important;
    max-width: 34px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    flex: 1 1 30px !important;
    border-radius: 7px;
  }

  .rail-icon {
    width: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    flex-basis: 16px !important;
  }

  .rail-separator {
    width: 1px !important;
    height: 22px !important;
    min-height: 22px !important;
    margin: 0 1px !important;
    flex: 0 0 1px !important;
  }
}
