/* ============================================
   RESTROY Global Responsive Design System
   Shared tokens + utilities for all surfaces
   ============================================ */

:root {
  --restroy-red: #dc2626;
  --restroy-red-dark: #b91c1c;
  --restroy-red-deep: #7f1d1d;
  --restroy-dark: #0f172a;
  --restroy-navy: #1e293b;
  --restroy-muted: #64748b;
  --restroy-border: #e2e8f0;
  --restroy-bg: #f8fafc;
  --restroy-card: #ffffff;
  --restroy-accent: #3b82f6;
  --restroy-accent-soft: #eff6ff;
  --restroy-ok: #16a34a;
  --restroy-warn: #d97706;
  --restroy-err: #dc2626;
  --restroy-radius: 16px;
  --restroy-radius-sm: 10px;
  --restroy-radius-lg: 24px;
  --restroy-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --restroy-shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
  --restroy-sidebar-w: 256px;
  --restroy-sidebar-w-collapsed: 72px;
  --restroy-topbar-h: 64px;
  --restroy-container: 1200px;
  --restroy-container-wide: 1400px;
  --restroy-gap: clamp(12px, 2vw, 24px);
  --restroy-section-y: clamp(40px, 6vw, 96px);
  --restroy-text-hero: clamp(1.75rem, 4vw + 0.5rem, 3.5rem);
  --restroy-text-h1: clamp(1.5rem, 2.5vw + 0.5rem, 2.5rem);
  --restroy-text-h2: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem);
  --restroy-text-body: clamp(0.875rem, 0.3vw + 0.75rem, 1rem);
  --restroy-touch: 44px;
  --restroy-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Base overflow safety --- */
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
body {
  overflow-x: clip;
  max-width: 100%;
}
img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}
video,
canvas {
  height: auto;
}
img {
  display: block;
}
button,
a,
input,
select,
textarea,
[role="button"] {
  touch-action: manipulation;
}
:where(a, button, [role="button"], input[type="submit"]) {
  min-height: var(--restroy-touch);
}
:where(input, select, textarea) {
  min-height: var(--restroy-touch);
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--restroy-red);
  outline-offset: 2px;
}
::selection {
  background: rgba(220, 38, 38, 0.18);
}

/* --- Containers --- */
.r-container {
  width: 100%;
  max-width: var(--restroy-container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.r-container-wide {
  width: 100%;
  max-width: var(--restroy-container-wide);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* --- Typography helpers --- */
.r-hero-title {
  font-size: var(--restroy-text-hero);
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}
.r-h1 {
  font-size: var(--restroy-text-h1);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.r-h2 {
  font-size: var(--restroy-text-h2);
  line-height: 1.25;
}
.r-body {
  font-size: var(--restroy-text-body);
  line-height: 1.6;
}
.r-mute {
  color: var(--restroy-muted);
  overflow-wrap: break-word;
}
.r-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.r-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Cards / surfaces --- */
.r-card {
  background: var(--restroy-card);
  border: 1px solid var(--restroy-border);
  border-radius: var(--restroy-radius);
  box-shadow: var(--restroy-shadow);
  overflow: hidden;
}
.r-card-pad {
  padding: clamp(16px, 3vw, 24px);
}

/* --- Buttons / touch --- */
.r-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--restroy-touch);
  min-width: var(--restroy-touch);
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s var(--restroy-ease), box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.r-btn:active {
  transform: scale(0.98);
}
.r-btn-primary {
  background: linear-gradient(135deg, var(--restroy-red), var(--restroy-red-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}
.r-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}
.r-btn-ghost {
  background: transparent;
  color: var(--restroy-muted);
  border: 1px solid var(--restroy-border);
}
.r-btn-sm {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 10px;
}

/* --- Tables (responsive strategy) --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
}
.table-responsive > table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
}
.table-responsive--card > table {
  min-width: 0;
}
@media (max-width: 640px) {
  .table-responsive--cards > thead {
    display: none;
  }
  .table-responsive--cards > tbody > tr {
    display: block;
    background: var(--restroy-card);
    border: 1px solid var(--restroy-border);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: var(--restroy-shadow);
  }
  .table-responsive--cards > tbody > tr > td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: none;
    text-align: right;
    white-space: normal;
  }
  .table-responsive--cards > tbody > tr > td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--restroy-muted);
    text-align: left;
    flex-shrink: 0;
  }
}

/* --- Charts --- */
.chart-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: clamp(200px, 30vw, 280px);
  overflow: hidden;
}
.chart-wrap canvas {
  width: 100% !important;
  max-width: 100%;
}

/* --- Modals --- */
.modal-overlay,
.r-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
}
.r-modal,
.modal-panel {
  width: calc(100% - 24px);
  max-width: 560px;
  max-height: min(90vh, 90dvh);
  overflow-y: auto;
  background: var(--restroy-card);
  border-radius: 20px;
  box-shadow: var(--restroy-shadow-lg);
  overscroll-behavior: contain;
}
.r-modal-wide {
  max-width: 840px;
}
@media (max-width: 480px) {
  .r-modal,
  .modal-panel {
    width: calc(100% - 16px);
    max-height: 92vh;
    border-radius: 16px;
  }
}

/* --- Dropdowns (keep in viewport) --- */
.r-dropdown {
  position: absolute;
  right: 0;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 24px));
  z-index: 60;
  background: var(--restroy-card);
  border: 1px solid var(--restroy-border);
  border-radius: 14px;
  box-shadow: var(--restroy-shadow-lg);
  overflow: hidden;
}

/* --- Panel sidebars (shared) --- */
.r-panel-main {
  flex: 1;
  min-width: 0;
  transition: margin 0.3s var(--restroy-ease);
}
.r-panel-main.no-shift {
  margin-left: 0 !important;
}

/* --- Grids --- */
.r-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--restroy-gap);
}
.r-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--restroy-gap);
}
.r-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--restroy-gap);
}
@media (max-width: 1024px) {
  .r-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .r-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .r-grid-2,
  .r-grid-3,
  .r-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* --- Forms --- */
.r-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
}
.r-form-grid > .full,
.r-form-grid > [data-span="full"] {
  grid-column: 1 / -1;
}
@media (max-width: 768px) {
  .r-form-grid {
    grid-template-columns: 1fr;
  }
}
.r-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.r-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--restroy-muted);
}
.r-field input,
.r-field select,
.r-field textarea {
  width: 100%;
  min-width: 0;
}

/* --- Empty states --- */
.r-empty {
  text-align: center;
  padding: clamp(32px, 6vw, 56px) clamp(16px, 4vw, 32px);
  color: var(--restroy-muted);
}
.r-empty i,
.r-empty .empty-icon {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 12px;
  opacity: 0.5;
}

/* --- Sticky panel header --- */
.r-sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px) saturate(160%);
}

/* --- Safe areas (notches) --- */
.r-safe-x {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.r-safe-b {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* --- Mobile nav overlay + drawer (single system) --- */
/* Layering: backdrop (65) < drawer (70) < navbar (80) */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 65;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-overlay[hidden] {
  display: block !important; /* keep for transition; visibility controls paint */
}
.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Hamburger — open control only (never morphs to X; drawer owns the single close) */
.nav-toggle {
  display: none;
}
@media (max-width: 1023.98px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }
  .nav-toggle__box {
    position: relative;
    width: 22px;
    height: 16px;
    display: block;
  }
  .nav-toggle__bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, width 0.3s ease;
    transform-origin: center;
  }
  .nav-toggle__bar:nth-child(1) { top: 0; }
  .nav-toggle__bar:nth-child(2) { top: 7px; }
  .nav-toggle__bar:nth-child(3) { top: 14px; width: 70%; left: auto; right: 0; }
}

/* Drawer: fixed right panel; when open covers from top (navbar is behind) */
#mobile-menu {
  display: block !important;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(85vw, 400px);
  max-width: 100vw;
  background: transparent;
  box-shadow: none;
  border: 0;
  max-height: none;
  height: auto;
  overflow: hidden;
  overscroll-behavior: contain;
  z-index: 70;
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  visibility: hidden;
  padding: 0;
  margin: 0;
}
#mobile-menu.mobile-menu-open {
  display: block !important;
  transform: translateX(0);
  visibility: visible;
}
#mobile-menu.hidden:not(.mobile-menu-open) {
  visibility: hidden;
}
#mobile-menu a {
  -webkit-tap-highlight-color: transparent;
}
/* stop clicks inside the drawer from bubbling to document-level close handlers */
#mobile-menu,
.mobile-drawer {
  pointer-events: auto;
}

.mobile-drawer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border-left: 1px solid rgba(15, 23, 42, 0.06);
  border-top: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: 16px 0 0 0;
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 56px;
}
.mobile-drawer__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0f172a;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.3s ease 0.08s, transform 0.3s ease 0.08s;
}
#mobile-menu.mobile-menu-open .mobile-drawer__title {
  opacity: 1;
  transform: none;
}
/* THE single close control (navbar hamburger does not become X) */
.mobile-drawer__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.08);
  color: #DC2626;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.6) rotate(-90deg);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-drawer__close-ico {
  display: inline-flex;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-drawer__close:hover {
  background: rgba(220, 38, 38, 0.14);
}
.mobile-drawer__close:hover .mobile-drawer__close-ico {
  transform: rotate(90deg);
}
.mobile-drawer__close:focus-visible {
  outline: 2px solid rgba(220, 38, 38, 0.55);
  outline-offset: 2px;
}
.mobile-drawer__close:active {
  transform: scale(0.9);
}
#mobile-menu.mobile-menu-open .mobile-drawer__close {
  opacity: 1;
  transform: none;
}
.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  min-height: 48px;
  border-radius: 14px;
  color: #334155;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease calc(var(--i, 0) * 0.04s + 0.1s),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 0.04s + 0.1s),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
#mobile-menu.mobile-menu-open .mobile-drawer__link {
  opacity: 1;
  transform: translateY(0);
}
.mobile-drawer__link:hover,
.mobile-drawer__link:focus-visible,
.mobile-drawer__link:active {
  background: rgba(220, 38, 38, 0.07);
  color: #DC2626;
  border-color: rgba(220, 38, 38, 0.12);
  box-shadow: 0 4px 12px -6px rgba(220, 38, 38, 0.35);
  outline: none;
}
.mobile-drawer__link--danger:hover,
.mobile-drawer__link--danger:focus-visible,
.mobile-drawer__link--danger:active {
  background: rgba(220, 38, 38, 0.1);
  color: #B91C1C;
}
.mobile-drawer__link--ghost {
  background: transparent;
  border-color: rgba(15, 23, 42, 0.1);
  justify-content: center;
}
.mobile-drawer__group {
  display: flex;
  flex-direction: column;
}
button.mobile-drawer__link--sub {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: inherit;
  text-align: left;
  color: #334155;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}
button.mobile-drawer__link--sub[aria-expanded="true"],
button.mobile-drawer__link--sub:focus-visible {
  background: rgba(220, 38, 38, 0.07);
  color: #DC2626;
  border-color: rgba(220, 38, 38, 0.12);
  outline: none;
}
button.mobile-drawer__link--sub[aria-expanded="true"] .mobile-drawer__ico {
  background: #fff;
  color: #DC2626;
}
.mobile-drawer__chev {
  margin-left: auto;
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}
button.mobile-drawer__link--sub[aria-expanded="true"] .mobile-drawer__chev {
  transform: rotate(180deg);
  color: #DC2626;
}
.mobile-drawer__sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 6px 14px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.04);
}
.mobile-drawer__sub[hidden] {
  display: none !important;
}
.mobile-drawer__sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  min-height: 44px;
  border-radius: 9px;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.mobile-drawer__sublink:hover,
.mobile-drawer__sublink:focus-visible,
.mobile-drawer__sublink:active {
  background: rgba(220, 38, 38, 0.08);
  color: #DC2626;
  outline: none;
}
.mobile-drawer__badge {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #059669;
  background: rgba(16, 185, 129, 0.14);
  padding: 3px 6px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.mobile-drawer__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #64748b;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
}
.mobile-drawer__link:hover .mobile-drawer__ico {
  background: #fff;
  color: #DC2626;
  transform: scale(1.06);
}
/* Login + Start For Free pinned to drawer bottom (guests only) */
.mobile-drawer__cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 12px 12px 8px;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), #fff);
  position: sticky;
  bottom: 0;
  z-index: 3;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.3s ease calc(var(--i, 0) * 0.04s + 0.1s),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 0.04s + 0.1s);
}
#mobile-menu.mobile-menu-open .mobile-drawer__cta-wrap {
  opacity: 1;
  transform: translateY(0);
}
.mobile-drawer__cta {
  display: block;
  text-align: center;
  padding: 14px 16px;
  min-height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 28px -12px rgba(220, 38, 38, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.mobile-drawer__cta:hover,
.mobile-drawer__cta:focus-visible,
.mobile-drawer__cta:active {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 32px -12px rgba(220, 38, 38, 0.8);
  outline: 2px solid rgba(220, 38, 38, 0.45);
  outline-offset: 2px;
}
.mobile-drawer__cta:active {
  transform: scale(0.98);
}
.mobile-drawer__foot {
  padding: 10px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.4s ease 0.3s;
}
/* when guest CTAs are present, keep footer compact under them */
.mobile-drawer__cta-wrap + .mobile-drawer__foot {
  border-top: 0;
  padding-top: 0;
}
#mobile-menu.mobile-menu-open .mobile-drawer__foot {
  opacity: 1;
}

/* Layering: navbar (80) when closed;
   when open: navbar drops behind backdrop (65) and drawer (70) */
#navbar {
  z-index: 80;
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
#navbar.nav-open {
  /* sit BEHIND the open menu system (backdrop 65 + drawer 70) */
  z-index: 50;
  background: transparent;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}
#navbar.nav-open > div:first-child {
  /* no elevated pill — whole bar goes to the back */
  z-index: auto;
}
@media (max-width: 1023.98px) {
  #mobile-toggle {
    position: relative;
    z-index: 81;
    pointer-events: auto;
  }
  #mobile-toggle:focus-visible {
    outline: 2px solid rgba(220, 38, 38, 0.55);
    outline-offset: 2px;
  }
}
@media (min-width: 1024px) {
  #mobile-menu {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  .mobile-overlay {
    display: none !important;
  }
}
@media (max-width: 1023.98px) {
  #features-dropdown {
    display: none !important;
  }
}
@media (max-width: 359.98px) {
  #mobile-menu {
    width: min(92vw, 400px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #mobile-menu,
  #navbar,
  .mobile-overlay,
  .mobile-drawer__link,
  .mobile-drawer__title,
  .mobile-drawer__close,
  .mobile-drawer__cta-wrap,
  .mobile-drawer__chev,
  .mobile-drawer__sublink,
  .nav-toggle__bar {
    transition: none !important;
  }
  #navbar.nav-open {
    transform: none;
  }
}

/* --- Contact page mobile UX --- */
.contact-field {
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}
.contact-field:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}
@media (max-width: 640px) {
  .contact-field {
    font-size: 16px; /* prevents iOS zoom on focus */
    min-height: 52px;
  }
  textarea.contact-field {
    min-height: 140px;
  }
  select.contact-field {
    background-position: right 1rem center;
  }
}

/* --- Marketing footer responsive --- */
.footer-touch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 768px) {
  .footer-touch-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .footer-touch-grid > * {
    min-width: 0;
  }
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}
@media (max-width: 1024px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand,
  .footer-download {
    grid-column: auto;
  }
  .footer-download {
    align-items: flex-start;
  }
}
@media (max-width: 640px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-download {
    grid-column: 1 / -1;
    align-items: flex-start;
  }
  .footer-col {
    min-width: 0;
  }
  .footer-col a {
    word-break: break-word;
  }
}
@media (max-width: 380px) {
  .footer-cols {
    grid-template-columns: 1fr;
  }
  .footer-brand,
  .footer-download {
    grid-column: auto;
  }
}

/* --- KOT / Kanban lanes --- */
.kot-lanes,
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
  max-width: 100%;
}
.kot-lanes > *,
.kanban-board > * {
  flex: 1 1 280px;
  min-width: min(280px, 85vw);
}
@media (max-width: 640px) {
  .kot-lanes > *,
  .kanban-board > * {
    flex: 0 0 min(300px, 88vw);
    min-width: min(300px, 88vw);
  }
}

/* --- Floor plan scroll --- */
.floor-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border-radius: var(--restroy-radius);
}

/* --- Payment / pricing cards --- */
.pay-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

/* --- Toast mobile --- */
@media (max-width: 480px) {
  .toast,
  #toast-container .toast,
  .sa-toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: none;
    width: auto;
    min-width: 0;
  }
  #toast-container {
    left: 12px;
    right: 12px;
    bottom: 16px;
    top: auto;
  }
}

/* --- Tooltips: prevent edge overflow --- */
[data-tooltip]:hover::after {
  max-width: min(240px, 70vw);
  white-space: normal;
  width: max-content;
}

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

/* --- Print --- */
@media print {
  .restroy-intro,
  #sidebar,
  #navbar,
  .mobile-menu,
  #toast-container {
    display: none !important;
  }
  body {
    background: #fff;
  }
}

/* --- Legacy admin sidebar helpers (app/base.html) --- */
.admin-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.admin-sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 768px) {
  .admin-sidebar-overlay {
    display: none !important;
  }
}
.admin-sidebar {
  transition: transform 0.3s var(--restroy-ease);
}
@media (max-width: 767.98px) {
  .admin-sidebar {
    box-shadow: var(--restroy-shadow-lg);
  }
}

/* --- Body lock when modal/drawer open --- */
body.modal-open,
body.sidebar-open,
body.rai-mobile-open {
  overflow: hidden;
  touch-action: none;
}
