:root {
  --a11y-focus-color: #8ac7ff;
  --a11y-focus-offset: #101820;
}

html[data-theme="light"] {
  --a11y-focus-color: #075fa8;
  --a11y-focus-offset: #ffffff;
}

html {
  scroll-padding-top: 5rem;
}

body {
  overflow-wrap: anywhere;
}

.site-skip-link {
  position: fixed;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 2000;
  padding: 0.7rem 1rem;
  border: 2px solid currentColor;
  border-radius: 0.4rem;
  background: var(--site-header-bg, #fff);
  color: var(--site-header-text, #111);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 120ms ease-out;
}

.site-skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

#main-content:focus {
  outline: none;
  box-shadow: none;
}

img,
video {
  max-width: 100%;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.task-modal-open {
  overflow: hidden;
}

.task-modal-status {
  padding: 0.75rem;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  background: rgba(30, 136, 229, 0.12);
}

.task-modal-status.is-error {
  color: #ffb4ab;
  background: rgba(186, 26, 26, 0.18);
}

html[data-theme="light"] .task-modal-status.is-error {
  color: #8c1d18;
  background: #ffdad6;
}

.color-picker-section > #taskColorLabel {
  font-size: 0.875rem;
  color: #b8b8b8;
}

html[data-theme="light"] .color-picker-section > #taskColorLabel {
  color: var(--site-muted, #555);
}

button.color-option {
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  appearance: none;
}

button.color-option.selected::after {
  content: "✓";
  position: absolute;
  inset: 50% auto auto 50%;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px #000, 0 0 2px #000;
  transform: translate(-50%, -50%);
}

.table-responsive,
[data-scroll-region] {
  overscroll-behavior-inline: contain;
}

@media (max-width: 480px) {
  #main-content,
  #main-content > * {
    min-width: 0;
  }

  .site-navbar .container-fluid {
    min-width: 0;
  }

  table:not(.calendar-grid):not([role="presentation"]) {
    max-width: 100%;
  }

  .task-modal {
    width: calc(100vw - 1rem);
    max-width: none;
    max-height: calc(100dvh - 1rem);
    border-radius: 0.75rem;
  }

  .task-modal .modal-header,
  .task-modal .modal-body,
  .task-modal .modal-footer {
    padding-inline: 0.85rem;
  }

  .task-modal .datetime-row,
  .task-modal .modal-footer {
    flex-wrap: wrap;
  }
}

@media (max-height: 560px) {
  .site-account-dropdown,
  .notification-dropdown {
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
  }
}

@media (pointer: coarse) {
  :where(
    button,
    select,
    textarea,
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    [role="button"]
  ) {
    min-block-size: 46px;
  }

  .site-pref-btn,
  .notification-bell,
  .navbar-toggler,
  .site-account-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .task-modal :is(.modal-close, .category-btn, .color-option, .add-notification-btn, .remove-notification-btn, .task-end-date-clear) {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
    outline: 3px solid Highlight !important;
    box-shadow: none !important;
  }

  .site-skip-link {
    border-color: ButtonText;
    forced-color-adjust: auto;
  }

  .color-option::after {
    color: ButtonText;
    text-shadow: none;
  }
}
