/* ============================================================
   Airelay Marketing Site — v2 design system
   Design tokens, base styles, reusable components.
   Tailwind handles utilities; this file defines the brand.
   ============================================================ */

:root {
  /* Brand palette */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-accent: #0ea5e9;

  /* Surfaces */
  --color-bg: #ffffff;
  --color-bg-soft: #f8fafc;
  --color-bg-muted: #f1f5f9;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;

  /* Borders */
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  /* Text */
  --color-text: #0f172a;
  --color-text-soft: #334155;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  /* Semantic */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.18);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;

  /* Containers */
  --container-max: 80rem;
  --content-max: 65ch;

  /* Z scale */
  --z-base: 0;
  --z-sticky: 40;
  --z-overlay: 50;
  --z-modal: 60;
  --z-toast: 70;
}

/* ============================================================
   Base
   ============================================================ */

* { box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

section[id] { scroll-margin-top: 5rem; }

img, svg { display: block; max-width: 100%; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

/* ============================================================
   Reusable components
   ============================================================ */

/* Section helpers */
.section { padding-block: clamp(4rem, 8vw, 6rem); }
.section-soft { background: var(--color-bg-soft); }
.section-muted { background: var(--color-bg-muted); }
.section-dark { background: #0f172a; color: var(--color-text-inverse); }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 42rem;
  margin-inline: auto;
  line-height: 1.6;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: 0 1px 2px rgb(37 99 235 / 0.2);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(37 99 235 / 0.25);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
}
.btn-ghost:hover { background: var(--color-bg-soft); color: var(--color-text); }

.btn-lg { padding: 0.9375rem 1.75rem; font-size: 1rem; border-radius: var(--radius-xl); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.card-body {
  color: var(--color-text-muted);
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* Feature bullet */
.feature-list { list-style: none; padding: 0; margin: 1rem 0 0 0; display: grid; gap: 0.5rem; }
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-soft);
  line-height: 1.5;
}
.feature-list li::before {
  content: '';
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310b981'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Grids */
.grid-3 { display: grid; gap: clamp(1.25rem, 2vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.grid-2 { display: grid; gap: clamp(1.25rem, 2vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid-4 { display: grid; gap: clamp(0.75rem, 1.5vw, 1.25rem); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

/* ============================================================
   Browser chrome wrapper for portal mockups
   ============================================================ */

.browser-chrome {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: var(--radius-xl);
  padding: 0.625rem 0.75rem;
  box-shadow: var(--shadow-2xl), 0 0 0 1px rgb(0 0 0 / 0.04);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--color-border);
}

.browser-chrome::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2.25rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--color-border);
}

.browser-dots {
  position: relative;
  display: flex;
  gap: 0.375rem;
  padding: 0.5rem 0.5rem 0.75rem;
}
.browser-dots span {
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: var(--radius-full);
}
.browser-dots span:nth-child(1) { background: #f87171; }
.browser-dots span:nth-child(2) { background: #fbbf24; }
.browser-dots span:nth-child(3) { background: #34d399; }

.browser-url {
  position: absolute;
  top: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.1875rem 0.75rem;
  pointer-events: none;
}

.browser-body {
  background: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

/* ============================================================
   Portal mockup tokens — mirror Ant Design / portal look
   ============================================================ */

.pm {
  --pm-bg: #ffffff;
  --pm-bg-soft: #fafafa;
  --pm-border: #f0f0f0;
  --pm-text: #262626;
  --pm-text-muted: #8c8c8c;
  --pm-primary: #1677ff;
  --pm-success: #52c41a;
  --pm-warning: #faad14;
  --pm-danger: #ff4d4f;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--pm-text);
  background: var(--pm-bg-soft);
  padding: 0.875rem;
  line-height: 1.4;
}

.pm-card {
  background: var(--pm-bg);
  border: 1px solid var(--pm-border);
  border-radius: 8px;
  padding: 0.875rem 1rem;
}

.pm-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pm-text);
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pm-kpi {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}
.pm-kpi-label { font-size: 0.6875rem; color: var(--pm-text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.pm-kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--pm-text); }
.pm-kpi-delta { font-size: 0.6875rem; color: var(--pm-success); font-weight: 500; }
.pm-kpi-delta.negative { color: var(--pm-danger); }

.pm-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  line-height: 1.4;
}
.pm-tag.success { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.pm-tag.warning { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.pm-tag.danger { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.pm-tag.info { background: #e6f4ff; color: #0958d9; border: 1px solid #91caff; }
.pm-tag.neutral { background: #fafafa; color: #595959; border: 1px solid #d9d9d9; }

.pm-dot { width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); display: inline-block; }
.pm-dot.success { background: var(--pm-success); }
.pm-dot.warning { background: var(--pm-warning); }
.pm-dot.danger { background: var(--pm-danger); }
.pm-dot.neutral { background: var(--pm-text-muted); }

.pm-sidebar {
  background: #001529;
  color: #ffffff;
  padding: 0.75rem 0.5rem;
  border-radius: 8px 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.pm-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
}
.pm-sidebar-item {
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pm-sidebar-item.active { background: var(--pm-primary); color: #fff; font-weight: 500; }
.pm-sidebar-item svg { width: 0.875rem; height: 0.875rem; }

.pm-table {
  width: 100%;
  font-size: 0.75rem;
  border-collapse: collapse;
}
.pm-table th {
  text-align: left;
  font-weight: 600;
  color: var(--pm-text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--pm-border);
}
.pm-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--pm-border);
}
.pm-table tr:last-child td { border-bottom: none; }
.pm-table tr:hover td { background: var(--pm-bg-soft); }

/* Portal mockup responsive — sidebar collapses, grids stack, tables scroll */
@media (max-width: 720px) {
  .pm { padding: 0.625rem; font-size: 0.75rem; }

  /* Outer layout: sidebar drops above main column */
  .pm > div[style*="grid-template-columns:160px"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  /* Sidebar becomes a horizontal scrolling chip strip */
  .pm-sidebar {
    flex-direction: row !important;
    overflow-x: auto;
    border-radius: 8px !important;
    padding: 0.375rem !important;
    gap: 0.25rem !important;
  }
  .pm-sidebar::-webkit-scrollbar { display: none; }
  .pm-sidebar { -ms-overflow-style: none; scrollbar-width: none; }
  .pm-sidebar-logo { display: none !important; }
  .pm-sidebar-item {
    flex-shrink: 0;
    font-size: 0.625rem;
    padding: 0.3125rem 0.5rem;
    white-space: nowrap;
  }
  .pm-sidebar-item svg { display: none; }

  /* 4-col KPI row -> 2x2 */
  .pm [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* 2-col cards -> single column */
  .pm [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* 3-col sync row -> single column */
  .pm [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  /* Devices 2-col -> single column */
  .pm [style*="grid-template-columns:repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  /* Tables go horizontal-scroll inside their card */
  .pm-card:has(.pm-table) { padding: 0 !important; }
  .pm-table { font-size: 0.6875rem; min-width: 28rem; }
  .pm-table th { padding: 0.4375rem 0.5rem; font-size: 0.625rem; }
  .pm-table td { padding: 0.5rem; }
  .pm-card > .pm-table,
  .pm-card[style*="padding:0"] { overflow-x: auto; display: block; }

  /* Browser chrome shrinks */
  .browser-chrome { padding: 0.5rem 0.5rem !important; }
  .browser-url { font-size: 0.5625rem !important; max-width: 60vw; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; padding: 0.125rem 0.5rem !important; }
}

/* Even smaller: tighten KPI tiles */
@media (max-width: 420px) {
  .pm-kpi-value { font-size: 1.125rem !important; }
  .pm-kpi-label { font-size: 0.5625rem !important; }
  .pm-card { padding: 0.625rem 0.75rem !important; }
  .browser-url { display: none; }
}

/* ============================================================
   Hero gradient
   ============================================================ */

.hero-gradient {
  background:
    radial-gradient(60rem 30rem at 50% -10%, rgb(37 99 235 / 0.12), transparent 70%),
    radial-gradient(40rem 20rem at 0% 30%, rgb(14 165 233 / 0.08), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(37 99 235 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(37 99 235 / 0.04) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 50%, transparent 100%);
  pointer-events: none;
}

/* ============================================================
   Logos strip
   ============================================================ */

.logos-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  justify-items: center;
}
.logos-strip img {
  height: 2rem;
  max-width: 10rem;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.65);
  transition: filter 0.2s ease;
}
.logos-strip img:hover { filter: grayscale(0) opacity(1); }

/* ============================================================
   Site header — solid, no blur (avoids mobile rendering issues)
   Sticky on desktop, normal flow on mobile to avoid covering content
   ============================================================ */

[data-header] { min-height: 4rem; }

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 40;
}

@media (min-width: 880px) {
  .site-header {
    position: sticky;
    top: 0;
  }
}

/* ============================================================
   Language switcher
   ============================================================ */

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.375rem 0.5rem 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: border-color 0.18s ease;
}
.lang-trigger:hover { border-color: var(--color-border-strong); }
.lang-trigger img {
  width: 1.125rem;
  height: 0.75rem;
  border-radius: 2px;
  object-fit: cover;
}

.lang-modal {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.5);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lang-modal.open { display: flex; }
.lang-modal-panel {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  max-width: 22rem;
  width: 100%;
  box-shadow: var(--shadow-2xl);
}
.lang-list { display: grid; gap: 0.5rem; margin-top: 1rem; }
.lang-list button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}
.lang-list button:hover { background: var(--color-bg-soft); border-color: var(--color-border-strong); }
.lang-list button[aria-current="true"] {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.lang-list img {
  width: 1.5rem;
  height: 1rem;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ============================================================
   Mobile portal mockup — dedicated phone-frame layout
   Shown on small screens, replaces desktop browser-chrome version
   ============================================================ */

.portal-mockup-desktop { display: block; }
.portal-mockup-mobile { display: none; }

@media (max-width: 720px) {
  .portal-mockup-desktop { display: none; }
  .portal-mockup-mobile { display: flex; justify-content: center; }
}

.phone-frame-lg {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border-radius: 2.5rem;
  padding: 0.625rem;
  box-shadow:
    0 30px 60px -20px rgb(0 0 0 / 0.4),
    0 0 0 1px rgb(0 0 0 / 0.06),
    inset 0 1px 0 rgb(255 255 255 / 0.08);
  width: 100%;
  max-width: 19.5rem;
  position: relative;
}
.phone-frame-lg::before {
  content: '';
  position: absolute;
  top: 0.875rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5.5rem;
  height: 1.125rem;
  background: #0a0a0a;
  border-radius: 9999px;
  z-index: 2;
}

.phone-screen-lg {
  background: #f8fafc;
  border-radius: 2rem;
  overflow: hidden;
  height: 33rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Phone status bar (time + signal) */
.mp-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0f172a;
  height: 2rem;
}
.mp-statusbar-icons {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.mp-statusbar-icons svg { width: 0.875rem; height: 0.875rem; }

/* Mobile portal top app bar */
.mp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.mp-topbar h1 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
.mp-topbar-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  position: relative;
}
.mp-topbar-btn svg { width: 1.0625rem; height: 1.0625rem; }
.mp-topbar-btn .badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 0.625rem;
  height: 0.625rem;
  background: #ef4444;
  border: 2px solid #fff;
  border-radius: 9999px;
}

/* Scrollable content area */
.mp-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.875rem 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.mp-content::-webkit-scrollbar { display: none; }
.mp-content { -ms-overflow-style: none; scrollbar-width: none; }

.mp-greeting {
  font-size: 0.6875rem;
  color: #64748b;
  font-weight: 500;
}
.mp-greeting strong {
  display: block;
  font-size: 0.9375rem;
  color: #0f172a;
  font-weight: 700;
  margin-top: 0.125rem;
}

/* KPI tiles 2x2 */
.mp-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.mp-kpi {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 0.625rem;
  padding: 0.625rem 0.75rem;
  position: relative;
  overflow: hidden;
}
.mp-kpi-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}
.mp-kpi-label {
  font-size: 0.5625rem;
  color: #8c8c8c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.mp-kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}
.mp-kpi-sub {
  font-size: 0.5625rem;
  color: #94a3b8;
  margin-top: 0.125rem;
}

/* Generic card */
.mp-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 0.625rem;
  padding: 0.75rem 0.875rem;
}
.mp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
}
.mp-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.mp-card-link {
  font-size: 0.6875rem;
  color: #1677ff;
  font-weight: 500;
}

/* List items */
.mp-list { display: flex; flex-direction: column; gap: 0.375rem; }
.mp-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
}
.mp-row-tint-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.mp-row-tint-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.mp-row-tint-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.mp-row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row-time { font-size: 0.5625rem; opacity: 0.7; }

/* Property card (Rentals) */
.mp-property {
  display: flex;
  gap: 0.625rem;
  padding: 0.625rem;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 0.625rem;
  align-items: center;
}
.mp-property-img {
  width: 2.75rem;
  height: 2.75rem;
  background: linear-gradient(135deg, #dbeafe, #c7d2fe);
  border-radius: 0.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.mp-property-info { flex: 1; min-width: 0; }
.mp-property-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-property-meta {
  font-size: 0.625rem;
  color: #64748b;
  display: flex;
  gap: 0.375rem;
  align-items: center;
}
.mp-property-status {
  font-size: 0.5625rem;
  padding: 0.125rem 0.4375rem;
  border-radius: 9999px;
  font-weight: 500;
}

/* Filter chip row */
.mp-chips {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.mp-chips::-webkit-scrollbar { display: none; }
.mp-chips { -ms-overflow-style: none; scrollbar-width: none; }
.mp-chip {
  font-size: 0.625rem;
  padding: 0.3125rem 0.625rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.mp-chip.active { background: #0f172a; color: #fff; border-color: #0f172a; }

/* Device card */
.mp-device {
  display: flex;
  gap: 0.625rem;
  padding: 0.625rem;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 0.625rem;
}
.mp-device-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
}
.mp-device-body { flex: 1; min-width: 0; }
.mp-device-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-device-meta {
  font-size: 0.625rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.mp-badges {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.mp-badge {
  font-size: 0.5625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
}
.mp-badge.ok { background: #dcfce7; color: #166534; }
.mp-badge.warn { background: #fef3c7; color: #92400e; }
.mp-badge.danger { background: #fee2e2; color: #991b1b; }
.mp-badge.neutral { background: #f1f5f9; color: #475569; }
.mp-badge .dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: currentColor;
}

/* Log entry */
.mp-log {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 0.625rem;
  padding: 0.625rem 0.75rem;
}
.mp-log-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}
.mp-log-time {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0f172a;
}
.mp-log-result-success { color: #166534; }
.mp-log-result-fail { color: #991b1b; }
.mp-log-actor {
  font-size: 0.6875rem;
  color: #0f172a;
  font-weight: 500;
  margin-bottom: 0.125rem;
}
.mp-log-property {
  font-size: 0.625rem;
  color: #64748b;
}

/* Bottom tab bar — iOS-style, clean (no per-tab borders or default button chrome) */
.mp-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
  padding: 0.4375rem 0.25rem 0.625rem;
  box-shadow: 0 -2px 8px -4px rgb(0 0 0 / 0.04);
}
.mp-tab {
  /* Reset native button defaults — without this, browser borders show through */
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1875rem;
  font-size: 0.5625rem;
  color: #94a3b8;
  padding: 0.375rem 0.25rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: color .15s ease, background .15s ease;
}
.mp-tab svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 1.75;
}
.mp-tab.active {
  color: #1677ff;
  font-weight: 600;
}
.mp-tab.active svg { stroke-width: 2.25; }

/* Day separator in logs */
.mp-day {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.25rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   How-it-works — vertical timeline on mobile
   ============================================================ */

@media (max-width: 720px) {
  .timeline-line { display: none; }
  .howitworks-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    max-width: 22rem;
    margin: 0 auto;
    position: relative;
  }
  .howitworks-grid::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    background: linear-gradient(180deg, #3b82f6, #6366f1, #a855f7, #f59e0b, #10b981);
    opacity: 0.2;
    border-radius: 2px;
  }
  .howitworks-step {
    text-align: left !important;
    display: grid;
    grid-template-columns: 3rem 1fr;
    column-gap: 1rem;
    row-gap: 0.25rem;
    align-items: start;
  }
  .howitworks-step > div:first-child {
    grid-row: span 2;
    margin: 0 !important;
  }
  .howitworks-step h3 { align-self: center; }
  .howitworks-step p { font-size: 0.8125rem !important; line-height: 1.45 !important; }
}

/* ============================================================
   Hero — mobile polish
   ============================================================ */

@media (max-width: 640px) {
  .hero-cta-row {
    flex-direction: column !important;
    width: 100%;
  }
  .hero-cta-row .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-stats {
    gap: 1rem !important;
  }
}

/* ============================================================
   Mobile typography tweaks for legibility + tap targets
   ============================================================ */

@media (max-width: 640px) {
  .section { padding-block: 3.5rem; }
  .section-header { margin-bottom: 2rem; }
  .card { padding: 1.25rem; }
  .btn { min-height: 2.75rem; }
  .btn-sm { min-height: 2.25rem; }

  /* Logos strip on mobile: 3 columns, smaller logos */
  .logos-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .logos-strip img { height: 1.5rem; max-width: 6rem; }
}

/* ============================================================
   Utility
   ============================================================ */

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

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