/* Mizan HQ — Preline-inspired responsive portal layer.
   Additive overrides only: keeps existing markup, API hooks and voice flows intact. */
:root {
  --mz-surface: #ffffff;
  --mz-canvas: #f4f7fb;
  --mz-border: #e6ebf2;
  --mz-border-strong: #d7e0ec;
  --mz-ink: #102b4e;
  --mz-muted: #64748b;
  --mz-primary: #2563eb;
  --mz-primary-hover: #1d4ed8;
  --mz-radius: 16px;
  --mz-shadow: 0 1px 2px rgba(16, 43, 78, .04), 0 10px 28px rgba(16, 43, 78, .055);
}
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .32);
  outline-offset: 2px;
}
.app { min-height: 100svh; }
.sb {
  background: var(--mz-surface);
  border-color: var(--mz-border);
  box-shadow: 0 8px 30px rgba(16, 43, 78, .035);
}
.lg { min-height: 44px; }
.lm { border-radius: 14px; }
.nv { min-height: 44px; border-radius: 11px; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nv:active { transform: scale(.985); }
.nv.on { background: #edf3ff; color: #1d4ed8; }
.sbf { border-radius: 14px; }
.tb {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,.94);
  border-color: var(--mz-border);
}
.sr, .ib { border-radius: 13px; }
.ct { max-width: 1680px; width: 100%; margin-inline: auto; }
.hd { align-items: center; }
.hd h1 { letter-spacing: -.025em; line-height: 1.35; }
.card {
  border-color: var(--mz-border);
  border-radius: var(--mz-radius);
  box-shadow: var(--mz-shadow);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ch h3, .card h3 { letter-spacing: -.01em; }
.btn, .cta {
  min-height: 44px;
  border-radius: 12px;
  box-shadow: 0 3px 9px rgba(37, 99, 235, .16);
}
.btn.o { box-shadow: none; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], select, textarea {
  min-height: 44px;
  border-color: var(--mz-border-strong);
  border-radius: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--mz-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
table { border-collapse: separate; border-spacing: 0; }
th { background: #f5f8fc; }
.toast-banner { border-radius: 14px; }

/* Tablet: preserve the desktop sidebar while tightening the workspace. */
@media (max-width: 1100px) {
  .sb { width: 232px; padding-inline: 14px; }
  .tb { padding-inline: 22px; }
  .ct { padding: 26px 22px 40px; }
  .g4 { gap: 14px; }
  .card { padding: 20px; }
}

/* Mobile: turn the sidebar into a compact, horizontally scrollable navigation rail. */
@media (max-width: 760px) {
  .app { display: flex; flex-direction: column; }
  .sb {
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--mz-border);
    box-shadow: 0 5px 18px rgba(16, 43, 78, .06);
  }
  .sb > .lg { flex: 0 0 auto; padding: 0; gap: 8px; }
  .sb .lm { width: 36px; height: 36px; }
  .lt b { font-size: 13px; white-space: nowrap; }
  .lt span { font-size: 9px; }
  .nvs {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding: 2px 0;
  }
  .nvs::-webkit-scrollbar { display: none; }
  .nv { flex: 0 0 auto; min-height: 38px; padding: 8px 10px; gap: 7px; font-size: 12px; white-space: nowrap; }
  .nv svg { width: 16px; height: 16px; }
  .nv-divider, .sbf { display: none; }
  .mn { width: 100%; min-width: 0; }
  .tb {
    position: relative;
    min-height: 62px;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .tb .sr { order: 3; flex: 1 0 100%; max-width: none; height: 40px; }
  .tb .sp { display: none; }
  .us { margin-inline-start: auto; }
  .ct { padding: 20px 14px 32px; gap: 18px; }
  .page { gap: 18px; }
  .hd { align-items: flex-start; }
  .hd h1 { font-size: 23px; }
  .hd p { font-size: 13px; line-height: 1.7; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .g3, .g2, .g2-eq { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .jr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .jr:before { display: none; }
  .card { min-width: 0; padding: 17px; border-radius: 14px; }
  .kv { font-size: 27px; }
  .ms { flex-wrap: wrap; gap: 14px 22px; }
  .bars { gap: 10px; overflow-x: auto; padding-bottom: 2px; }
  .bc { min-width: 34px; }
  table { min-width: 620px; }
  .card { overflow-x: auto; }
  .toast-banner { left: 12px; right: 12px; bottom: 12px; text-align: center; }
}

@media (max-width: 420px) {
  .sb { gap: 8px; padding-inline: 10px; }
  .sb > .lg { gap: 6px; }
  .lt b { font-size: 11px; }
  .lt span { display: none; }
  .nv { padding: 8px; }
  .nv svg { display: none; }
  .tb { padding-inline: 10px; }
  .ct { padding-inline: 10px; }
  .g4 { gap: 9px; }
  .card { padding: 14px; }
  .kv { font-size: 24px; }
  .hd .btn, .hd .cta { width: 100%; justify-content: center; }
}

/* Honor reduced-motion preferences without removing state feedback. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Public surfaces: landing, sign-in and internal search. */
.nav { flex-wrap: wrap; }
.nav nav { min-width: 0; }
.hero, .sec, .cb, .ft { min-width: 0; }
@media (max-width: 760px) {
  .nav {
    height: auto;
    min-height: 68px;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .nav nav {
    order: 5;
    flex: 1 0 100%;
    gap: 18px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding: 4px 0;
  }
  .nav nav::-webkit-scrollbar { display: none; }
  .nav > .btn { min-height: 40px; height: 40px; padding-inline: 12px; font-size: 12px; }
  .hero { padding: 48px 20px; gap: 28px; }
  .hero h1 { font-size: clamp(30px, 7vw, 40px); line-height: 1.3; }
  .hero p { font-size: 16px; }
  .sec { padding: 56px 20px; }
  .sec h2 { font-size: 27px; }
  .sec .sub { margin-bottom: 30px; font-size: 15px; }
  .cb { margin: 0 20px 48px; padding: 28px; border-radius: 16px; }
  .cb h2 { font-size: 24px; }
  .ft { padding: 24px 20px; flex-wrap: wrap; gap: 8px 20px; }
  .fm { padding: 32px 20px; }
  .pn { padding: 36px 20px; }
}
@media (max-width: 420px) {
  .nav { padding-inline: 10px; gap: 8px; }
  .nav .lg { font-size: 14px; }
  .nav .lm { width: 34px; height: 34px; }
  .nav > .btn { flex: 1 1 auto; justify-content: center; }
  .hero { padding: 38px 16px; }
  .hero .r .btn { width: 100%; justify-content: center; }
  .sec { padding: 44px 16px; }
  .cb { margin-inline: 10px; padding: 24px 18px; }
  .cb .btn { width: 100%; justify-content: center; }
  .ft { padding-inline: 16px; font-size: 12px; }
  .fm { padding: 28px 16px; }
  .pn { padding: 28px 16px; }
}

/* Logical-direction support for a future English/LTR page mode. */
[dir="ltr"] body, [dir="ltr"] .app { direction: ltr; }
[dir="ltr"] .sb { border-left: 0; border-right: 1px solid var(--mz-border); }
[dir="ltr"] .nv { text-align: left; }
[dir="ltr"] th { text-align: left; }
[dir="ltr"] .toast-banner { left: auto; right: 24px; border-right: 0; border-left: 4px solid #12a06a; }
@media (max-width: 760px) {
  [dir="ltr"] .sb { border-right: 0; }
  [dir="ltr"] .toast-banner { left: 12px; right: 12px; }
}

/* Language switcher and full-page direction handling. */
.mz-language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d7e0ec;
  border-radius: 11px;
  background: #fff;
  color: #17365d;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 43, 78, .06);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.mz-language-toggle:hover { background: #f4f7fc; border-color: #9eb5d3; }
.mz-language-toggle:active { transform: scale(.98); }
.mz-language-toggle:focus-visible { outline: 3px solid rgba(37, 99, 235, .3); outline-offset: 2px; }
html[dir="ltr"] .pg, html[dir="ltr"] .app { direction: ltr; }
html[dir="ltr"] .sb { border-left: 0; border-right: 1px solid var(--mz-border); }
html[dir="ltr"] .nv { text-align: left; }
html[dir="ltr"] .nv svg { flex: 0 0 auto; }
html[dir="ltr"] th { text-align: left; }
html[dir="ltr"] .ct { text-align: left; }
html[dir="ltr"] .hd { text-align: left; }
html[dir="ltr"] .toast-banner { left: auto; right: 24px; border-right: 0; border-left: 4px solid #12a06a; }
html[dir="ltr"] .tb .sr { direction: ltr; }
html[dir="ltr"] input, html[dir="ltr"] textarea, html[dir="ltr"] select { text-align: left; }
html[dir="ltr"] .nav nav { direction: ltr; }
@media (max-width: 760px) {
  .mz-language-toggle { min-width: 76px; min-height: 36px; padding: 7px 10px; font-size: 12px; }
  html[dir="ltr"] .sb { border-right: 0; }
  html[dir="ltr"] .toast-banner { left: 12px; right: 12px; }
}