:root {
  --bp-sm: 576px;
  --bp-md: 768px;
  --bp-lg: 992px;
  --bp-xl: 1200px;
  --btn-primary: #2563eb;
  --btn-primary-hover: #1d4ed8;
  --btn-danger: #dc2626;
  --btn-danger-hover: #b91c1c;
  --btn-secondary: #475569;
  --z-base: 0;
  --z-dropdown: 900;
  --z-overlay: 1000;
  --z-modal: 1100;
  --z-toast: 1200;
  --z-tooltip: 1300;
}

html {
  font-size: clamp(14px, 100%, 16px);
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin: 0.7rem auto 1.35rem;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(16px);
}

.section-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.2rem;
  min-height: 2.45rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.72));
  color: #1f2937;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.section-tab[aria-current="page"] {
  border-color: rgba(255, 255, 255, 0.68);
  background: var(--section-tab-active-bg, linear-gradient(135deg, #2563eb, #22d3ee));
  color: #ffffff;
  box-shadow:
    0 10px 22px var(--section-tab-active-shadow, rgba(37, 99, 235, 0.26)),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.section-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.section-tab[aria-current="page"]:hover {
  color: #ffffff;
  background: var(--section-tab-active-bg, linear-gradient(135deg, #2563eb, #22d3ee));
}

.fsqr-section {
  --section-tab-active-bg: linear-gradient(135deg, #1d4ed8 0%, #23c3df 100%);
  --section-tab-active-shadow: rgba(35, 195, 223, 0.34);
}

.group-section {
  --section-tab-active-bg: linear-gradient(135deg, #166534 0%, #22c55e 100%);
  --section-tab-active-shadow: rgba(34, 197, 94, 0.3);
}

.note-section {
  --section-tab-active-bg: linear-gradient(135deg, #4d7c0f 0%, #84cc16 100%);
  --section-tab-active-shadow: rgba(132, 204, 22, 0.32);
}

.task-section {
  --section-tab-active-bg: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  --section-tab-active-shadow: rgba(245, 158, 11, 0.32);
}

.section-tab:focus-visible,
.simple-footer a:focus-visible {
  outline: 3px solid var(--focus-ring-color, rgba(37, 99, 235, 0.32));
  outline-offset: 2px;
}

.footer-link-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.footer-link-button:focus-visible {
  outline: 3px solid var(--focus-ring-color, rgba(37, 99, 235, 0.32));
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 767.98px) {
  .section-tabs {
    width: calc(100% - 1.5rem) !important;
    max-width: calc(100% - 1.5rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 0.3rem !important;
    padding: 0.3rem !important;
    border-radius: 16px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  .section-tab {
    flex: 1 1 calc(30% - 0.3rem) !important;
    min-width: 0 !important;
    min-height: 2.35rem !important;
    padding: 0.55rem 0.4rem !important;
    font-size: 0.85rem !important;
  }

  .section-tab:first-child {
    flex: 1 1 100% !important;
    width: 100% !important;
    font-size: 1rem !important;
    margin-bottom: 0.2rem !important;
  }
}

@media print {
  header,
  footer,
  .section-tabs,
  .search-link,
  .cookie-consent-overlay,
  .fsqr-alert-modal-overlay,
  .fsqr-tooltip {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}

/*
 * Breakpoint policy:
 * - max-width: 575.98px  (sm down)
 * - max-width: 767.98px  (md down)
 * - max-width: 991.98px  (lg down)
 * - min-width: 768px / 992px (md up / lg up)
 */
