/*
 * host123 Webmail utilities: single-purpose helpers. This is the only stylesheet where !important
 * is allowed (§34.3): a utility must win over component rules regardless of specificity.
 */

/* Visibility */
[hidden] {
  display: none !important;
}
.hidden {
  display: none !important;
}
.invisible {
  visibility: hidden !important;
}
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sr-only-focusable:focus,
.sr-only-focusable:focus-within {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
}

/* Screen size helpers (breakpoints of §29.3). Like layout.css, print behaves as the single-column
   base layout whatever the paper width is. */
@media print, (max-width: 767.98px) {
  .hide-mobile { display: none !important; }
}
@media screen and (min-width: 768px) {
  .only-mobile { display: none !important; }
}
@media print, (max-width: 1279.98px) {
  .only-wide { display: none !important; }
}
@media screen and (min-width: 1280px) {
  .hide-wide { display: none !important; }
}

/* Print helpers (print.css hides the chrome; these mark content explicitly) */
@media screen {
  .print-only { display: none !important; }
}
@media print {
  .no-print { display: none !important; }
}

/* Display and flex */
.block { display: block !important; }
.inline { display: inline !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.grow { flex-grow: 1 !important; }
.shrink-0 { flex-shrink: 0 !important; }
.flex-1 { flex: 1 1 0 !important; min-width: 0 !important; }
.items-start { align-items: flex-start !important; }
.items-center { align-items: center !important; }
.items-end { align-items: flex-end !important; }
.items-baseline { align-items: baseline !important; }
.self-start { align-self: flex-start !important; }
.self-center { align-self: center !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.ms-auto { margin-inline-start: auto !important; }
.ms-1 { margin-inline-start: var(--space-1) !important; }
.ms-2 { margin-inline-start: var(--space-2) !important; }
.me-auto { margin-inline-end: auto !important; }
.min-w-0 { min-width: 0 !important; }
.min-h-0 { min-height: 0 !important; }
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.max-w-sm { max-width: 400px !important; }
.max-w-md { max-width: 560px !important; }
.max-w-lg { max-width: 800px !important; }
.mx-auto { margin-inline: auto !important; }

/* Gaps */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-5 { gap: var(--space-5) !important; }
.gap-6 { gap: var(--space-6) !important; }
.gap-8 { gap: var(--space-8) !important; }

/* Grid helpers: auto-fitting columns for forms and cards */
.grid-2 { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important; }
.grid-3 { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)) !important; }

/* Spacing (margin / padding) */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-6 { padding: var(--space-6) !important; }
.px-3 { padding-inline: var(--space-3) !important; }
.px-4 { padding-inline: var(--space-4) !important; }
.py-2 { padding-block: var(--space-2) !important; }
.py-3 { padding-block: var(--space-3) !important; }

/* Text */
.text-xs { font-size: var(--fs-xs) !important; }
.text-sm { font-size: var(--fs-sm) !important; }
.text-md { font-size: var(--fs-md) !important; }
.text-lg { font-size: var(--fs-lg) !important; }
.text-xl { font-size: var(--fs-xl) !important; }
.font-normal { font-weight: var(--fw-normal) !important; }
.font-medium { font-weight: var(--fw-medium) !important; }
.font-semibold { font-weight: var(--fw-semibold) !important; }
.font-bold { font-weight: var(--fw-bold) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-default { color: var(--text) !important; }
.text-brand { color: var(--brand-text) !important; }
.text-success { color: var(--success-text) !important; }
.text-warning { color: var(--warning-text) !important; }
.text-danger { color: var(--danger-text) !important; }
.text-info { color: var(--info-text) !important; }
.text-start { text-align: start !important; }
.text-center { text-align: center !important; }
.text-end { text-align: end !important; }
.mono { font-family: var(--font-mono) !important; }
.tabular { font-variant-numeric: tabular-nums !important; }
.uppercase { text-transform: uppercase !important; }
.nowrap { white-space: nowrap !important; }
.pre-wrap { white-space: pre-wrap !important; }
.break-all { word-break: break-all !important; overflow-wrap: anywhere !important; }
/* Wraps between words; a single word (an address) is split only when it cannot fit at all. In a table the column
   keeps the width of its longest word instead of breaking every address mid-word. */
.break-words { word-break: normal !important; overflow-wrap: break-word !important; }
.truncate {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.line-clamp-2 {
  display: -webkit-box !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
}

/* Surfaces and borders */
.surface { background: var(--surface) !important; }
.surface-strong { background: var(--surface-strong) !important; }
.surface-sunken { background: var(--surface-sunken) !important; }
.border { border: 1px solid var(--border) !important; }
.border-top { border-top: 1px solid var(--border) !important; }
.border-bottom { border-bottom: 1px solid var(--border) !important; }
.border-0 { border: 0 !important; }
.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* Overflow and interaction */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.scroll-y { overflow-y: auto !important; overscroll-behavior: contain !important; }
.select-none { user-select: none !important; }
.select-text { user-select: text !important; }
.pointer { cursor: pointer !important; }
.pointer-events-none { pointer-events: none !important; }
.relative { position: relative !important; }
/* Applied to <body> while a modal is open. */
.is-scroll-locked { overflow: hidden !important; }
