:root {
  --focus-ring-color: #2563eb;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

#main {
  scroll-margin-top: 6rem;
}

.sr-only,
.visually-hidden,
.a11y-live-region {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

.skip-link {
  background: #111827;
  border: 2px solid #ffffff;
  border-radius: 8px;
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 800;
  left: 1rem;
  line-height: 1.2;
  padding: 0.8rem 1rem;
  position: fixed;
  text-decoration: none;
  top: 1rem;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
  z-index: 100000;
}

.skip-link:focus,
.skip-link:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 2px;
  transform: translateY(0);
}

a,
button,
input,
select,
textarea,
[role="button"] {
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

img,
video,
canvas,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

[aria-disabled="true"],
.disabled {
  cursor: not-allowed;
}

.a11y-clickable {
  cursor: pointer;
}

.a11y-clickable:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

[aria-invalid="true"] {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16) !important;
}

[aria-invalid="true"]:focus {
  outline-color: rgba(185, 28, 28, 0.35) !important;
}

.accessibility-tools {
  bottom: 1rem;
  left: 1rem;
  position: fixed;
  z-index: 99990;
}

.accessibility-tools__toggle {
  align-items: center;
  background: #111827;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 1rem;
}

.accessibility-tools__toggle-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  height: 1.65rem;
  justify-content: center;
  letter-spacing: 0;
  width: 1.65rem;
}

.accessibility-tools__panel {
  background: #ffffff;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  bottom: calc(100% + 0.75rem);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  color: #1f2937;
  left: 0;
  max-width: min(92vw, 320px);
  padding: 1rem;
  position: absolute;
  width: 300px;
}

.accessibility-tools__panel[hidden] {
  display: none !important;
}

.accessibility-tools__title {
  color: #111827;
  font-size: 1rem;
  font-weight: 850;
  margin: 0 0 0.75rem;
}

.accessibility-tools__grid {
  display: grid;
  gap: 0.5rem;
}

.accessibility-tools__panel button {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 750;
  gap: 0.5rem;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 0.8rem;
  text-align: left;
  width: 100%;
}

.accessibility-tools__panel button[aria-pressed="true"] {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0f172a;
}

html.a11y-large-text body {
  font-size: 112.5% !important;
}

html.a11y-underline-links a {
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
}

html.a11y-high-contrast body {
  background: #ffffff !important;
  color: #111111 !important;
}

html.a11y-high-contrast a {
  color: #003cff !important;
}

html.a11y-high-contrast button,
html.a11y-high-contrast input,
html.a11y-high-contrast select,
html.a11y-high-contrast textarea {
  border-color: #111111 !important;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.001ms !important;
}

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

@media (forced-colors: active) {
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  button,
  input,
  select,
  textarea,
  [role="button"],
  .a11y-clickable {
    forced-color-adjust: auto;
  }

  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [role="button"]:focus-visible,
  .a11y-clickable:focus-visible {
    outline: 3px solid Highlight !important;
    outline-offset: 3px !important;
  }

  [aria-invalid="true"] {
    border: 2px solid Mark !important;
  }
}

.swal2-popup {
  max-width: min(96vw, 640px) !important;
}

.swal2-html-container {
  overflow-wrap: anywhere;
}

@media (max-width: 736px) {
  .accessibility-tools {
    bottom: 0.75rem;
    left: 0.75rem;
  }

  .accessibility-tools__toggle {
    min-height: 44px;
    padding: 0 0.85rem;
  }

  .accessibility-tools__toggle-text {
    display: none;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  a.btn,
  .btn,
  [role="button"] {
    min-height: 42px;
  }
}

/*
 * Mobile readability floor
 * Keeps text legible on narrow Samsung/Galaxy viewports without changing the
 * desktop layout. Page-specific styles can still use larger sizes.
 */
@media (max-width: 820px) {
  html {
    font-size: 16px !important;
  }

  body {
    font-size: 1rem !important;
    line-height: 1.55;
  }

  #page-wrapper,
  #main,
  .container,
  .compact-container,
  .swal2-popup {
    overflow-wrap: anywhere;
  }

  p,
  li,
  td,
  th,
  .td,
  .th,
  .table-row,
  .ticket-row,
  .ticket-main,
  .ticket-subject,
  .ticket-copy,
  .ticket-description,
  .notice-card,
  .notice-body,
  .ad-card,
  .ad-card-body,
  .ad-description,
  .document-card,
  .document-card-title,
  .doc-link-card,
  .doc-info div,
  .board-tool-copy strong,
  .board-tool-copy span,
  .user-tool-copy strong,
  .user-tool-copy span,
  .profile-value,
  .meta-value,
  .meta-item span,
  .section-copy,
  .issue-content p,
  .comment-text,
  .comment-body,
  .swal2-html-container,
  .fc-event-title,
  .fc-list-event-title {
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  label,
  small,
  .meta-label,
  .details-label,
  .editable-label,
  .section-label,
  .ticket-meta,
  .ticket-meta span,
  .comment-date,
  .doc-info small,
  .attachment-empty,
  .document-meta,
  .ad-meta,
  .classified-meta,
  .month-group-label,
  .unit-group-label,
  .category-header,
  .classified-category-header,
	  .status-badge,
	  .status-pill,
	  .rental-status-tag,
	  .priority-badge,
	  .photo-pill,
	  .count-pill,
	  .ad-pill,
	  .notice-pill,
	  .badge,
	  .pill,
	  .tag,
	  [class*="label"],
	  [class*="meta"],
	  [class*="eyebrow"],
	  [class*="hint"],
	  [class*="caption"],
	  [class*="kicker"],
	  [class*="status"],
	  [class*="date"],
	  [class*="counter"],
	  [class*="position"],
	  [class*="badge"],
	  [class*="pill"],
	  [class*="tag"],
  #counterMsg,
  .form-help,
  .help-text,
  .field-hint,
  .t-id,
  .t-unit,
  .t-date,
  .page-header-eyebrow,
  .board-eyebrow,
  .board-ticket-eyebrow,
  .tickets-eyebrow,
  .document-eyebrow,
  .notices-eyebrow,
  .classifieds-eyebrow,
  .calendar-eyebrow,
  .form-eyebrow,
  .profile-eyebrow,
  .directory-eyebrow,
  .swal2-validation-message {
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
  }

  button,
  input,
  select,
  textarea,
  .btn,
  .btn-action,
  .button,
  .board-primary-action,
  .calendar-create-action,
  .classified-action,
  .classified-btn,
  .document-view-toggle,
  .swal2-confirm,
  .swal2-cancel,
  .swal2-deny,
  [role="button"] {
    font-size: 1rem !important;
    line-height: 1.2 !important;
    min-height: 44px !important;
  }

  .swal2-title,
  .comment-header h3,
  .section-title,
  .card-title,
  .issue-content h2 {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
  }

  [style*="font-size:10px"],
  [style*="font-size: 10px"],
  [style*="font-size:11px"],
  [style*="font-size: 11px"],
  [style*="font-size:12px"],
  [style*="font-size: 12px"],
  [style*="font-size:13px"],
  [style*="font-size: 13px"] {
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
  }

  [style*="font-size:14px"],
  [style*="font-size: 14px"] {
    font-size: 0.9375rem !important;
    line-height: 1.45 !important;
  }
}

/* Button loading spinner */
.button__text {
  transition: all 0.2s;
}

.button--loading .button__text {
  visibility: hidden;
  opacity: 0;
}

.button--loading::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 25px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 4px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }

  to {
    transform: rotate(1turn);
  }
}

/* Custom checkbox */
.check {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 20px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.check input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 30px;
  width: 30px;
  background-color: #eee;
}

.check:hover input ~ .checkmark {
  background-color: #ccc;
}

.check input:checked ~ .checkmark {
  background-color: #2196F3;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.check input:checked ~ .checkmark:after {
  display: block;
}

.check .checkmark:after {
  left: 11px;
  top: 6px;
  width: 9px;
  height: 15px;
  border: solid white;
  border-width: 0 3px 3px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

/* Image thumbnails */
.thumbnail {
  width: 65px;
  height: 65px;
  margin: 5px;
  display: inline-block;
  border: none;
  border-radius: 5px;
}

.thumbnail img {
  width: 65px;
  height: 65px;
  margin: 5px;
  border: none;
  border-radius: 5px;
}

.thumbnail:hover,
.thumbnail img:hover {
  border: 1px red;
  border-radius: 5px;
}

/* Basic modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0,0.4);
  padding-top: 60px;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.images img {
  width: 100px;
  height: auto;
  margin: 5px;
}

/* Page loading spinner */
.loader {
  display: none;
  top: 50%;
  left: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
}

.loading {
  position: fixed;
  z-index: 1031;
  overflow: show;
  margin: auto;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
}

.loading:before {
  content: '';
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background-color: rgba(255,255,255,0.5);
}

.loading:not(:required) {
  font: 0/0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}

.loading:not(:required):after {
  content: '';
  display: block;
  font-size: 10px;
  width: 100px;
  height: 100px;
  margin-top: -0.5em;
  border: 15px solid rgba(33, 150, 243, 1.0);
  border-radius: 100%;
  border-bottom-color: transparent;
  -webkit-animation: spinner 1s linear 0s infinite;
  animation: spinner 1s linear 0s infinite;
}

@-webkit-keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@-moz-keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@-o-keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
