:root {
  --bg: #f5f3ef;
  --canvas: #f7f8fa;
  --panel: #ffffff;
  --sidebar: #ffffff;
  --text: #1e1b18;
  --muted: #6f6b66;
  --border: #dedad2;
  --border-soft: #ebe8e2;
  --purple: #714b67;
  --purple-dark: #55344d;
  --purple-soft: #f3edf2;
  --teal: #017e84;
  --teal-soft: #e8f5f4;
  --green: #15805d;
  --green-soft: #eaf7f1;
  --amber: #a66a12;
  --amber-soft: #fff5df;
  --danger: #b4233b;
  --danger-soft: #fff0f2;
  --shadow: 0 18px 55px rgba(30, 27, 24, 0.09);
  --shadow-soft: 0 6px 24px rgba(30, 27, 24, 0.06);
  --radius: 18px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(145deg, var(--purple), var(--teal));
  box-shadow: 0 7px 18px rgba(113, 75, 103, 0.24);
}
.brand-copy { display: grid; line-height: 1.05; min-width: 0; }
.brand-copy strong { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }

.public-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(222, 218, 210, 0.72);
  background: rgba(245, 243, 239, 0.9);
  backdrop-filter: blur(16px);
}
.public-nav {
  max-width: 1160px;
  min-height: 68px;
  margin: auto;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.public-actions { display: flex; align-items: center; gap: 8px; }
.public-main { min-height: calc(100vh - 68px); }

.error-page {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-height: 100vh;
  padding: 32px 16px;
  text-align: center;
}
.error-page .brand { margin-bottom: 20px; }
.error-page h1 { margin: 0; font-size: 26px; }
.error-code { margin: 0; color: var(--purple); font-size: 56px; font-weight: 800; line-height: 1; }
.error-text { max-width: 420px; margin: 0 0 12px; color: var(--muted); }

.button {
  min-height: 42px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, .portal-nav a:focus-visible, .logout-button:focus-visible {
  outline: 3px solid rgba(113, 75, 103, 0.18);
  outline-offset: 2px;
}
.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  box-shadow: 0 8px 22px rgba(113, 75, 103, 0.22);
}
.button-primary:hover { box-shadow: 0 12px 28px rgba(113, 75, 103, 0.28); }
.button-ghost { border-color: var(--border); background: #fff; }
.button-ghost:hover { border-color: var(--purple); color: var(--purple); }
.button-large { min-height: 50px; padding: 13px 24px; border-radius: 14px; }
.button-block { width: 100%; min-height: 49px; margin-top: 8px; }

.hero {
  position: relative;
  max-width: 1160px;
  min-height: 680px;
  margin: auto;
  padding: 78px 28px 62px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, 0.96fr);
  align-items: center;
  gap: 76px;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 580px;
  height: 580px;
  top: -190px;
  right: -220px;
  background: radial-gradient(circle, rgba(113, 75, 103, 0.13), transparent 68%);
}
.hero::after {
  width: 480px;
  height: 480px;
  bottom: -160px;
  left: -160px;
  background: radial-gradient(circle, rgba(1, 126, 132, 0.1), transparent 68%);
}
.eyebrow, .kicker {
  color: var(--purple);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.01em;
}
.eyebrow {
  width: fit-content;
  margin-bottom: 20px;
  padding: 7px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(113, 75, 103, 0.19);
  border-radius: 999px;
  background: rgba(113, 75, 103, 0.07);
}
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); }
.hero h1, .auth-aside h1 {
  margin: 0;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.16;
  letter-spacing: -0.04em;
}
.hero h1 em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  background-clip: text;
}
.hero-copy > p, .auth-aside > p {
  max-width: 570px;
  margin: 22px 0 30px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}
.hero-actions { display: flex; gap: 11px; flex-wrap: wrap; }
.trust-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.trust-row span::first-letter { color: var(--green); }

.hero-preview {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(30, 27, 24, 0.14);
  transform: rotate(-1deg);
}
.preview-header {
  min-height: 62px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}
.preview-header > div { display: flex; align-items: center; gap: 9px; }
.online-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #19b87b; box-shadow: 0 0 0 4px rgba(25, 184, 123, 0.11); }
.preview-body { padding: 18px; display: grid; gap: 10px; background: #faf9f7; }
.preview-step {
  padding: 14px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fff;
}
.preview-step.active { border-color: rgba(113, 75, 103, 0.35); box-shadow: 0 5px 16px rgba(113, 75, 103, 0.08); }
.step-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--canvas); font-weight: 900; }
.preview-step.done .step-number { color: #fff; background: var(--green); }
.preview-step.active .step-number { color: #fff; background: linear-gradient(145deg, var(--purple), var(--teal)); }
.preview-step div { display: grid; gap: 3px; }
.preview-step small { color: var(--muted); }
.preview-step b { color: var(--muted); font-size: 11px; }
.preview-step.done b { color: var(--green); }
.preview-step.active b { color: var(--purple); }
.preview-footer { padding: 16px 18px; display: flex; gap: 12px; align-items: center; }
.preview-footer > span:last-child { display: grid; gap: 3px; }
.preview-footer small { color: var(--muted); }
.shield { width: 36px; height: 36px; display: grid; place-items: center; color: var(--teal); border-radius: 11px; background: var(--teal-soft); }

.pill {
  min-height: 28px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: currentColor; }
.pill.purple { color: var(--purple); background: var(--purple-soft); }
.pill.teal { color: var(--teal); background: var(--teal-soft); }
.pill.success { color: var(--green); background: var(--green-soft); }
.pill.amber { color: var(--amber); background: var(--amber-soft); }
.pill.muted { color: var(--muted); background: var(--canvas); }
.pill.small { min-height: 24px; padding: 4px 8px; font-size: 10px; }

.feature-strip {
  max-width: 1160px;
  margin: 0 auto 80px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.feature-strip article { padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.65); }
.feature-strip article > span { color: var(--purple); font-size: 11px; font-weight: 900; }
.feature-strip strong { margin: 6px 0; display: block; }
.feature-strip p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 13px; }

.auth-layout {
  max-width: 1120px;
  min-height: calc(100vh - 68px);
  margin: auto;
  padding: 54px 28px;
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(520px, 1.15fr);
  align-items: center;
  gap: 70px;
}
.auth-layout.compact { max-width: 980px; grid-template-columns: 1fr 0.85fr; }
.auth-aside h1 { max-width: 500px; font-size: clamp(34px, 4vw, 50px); }
.form-card {
  padding: 34px;
  border: 1px solid rgba(222, 218, 210, 0.9);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.form-card.narrow { max-width: 460px; width: 100%; justify-self: end; }
.form-heading { margin-bottom: 26px; }
.form-heading h2 { margin: 8px 0 6px; font-size: 25px; }
.form-heading p { margin: 0; color: var(--muted); }
.form-step { color: var(--purple); font-size: 11px; font-weight: 900; }
.field-grid { display: grid; gap: 18px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { margin-bottom: 18px; display: grid; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 850; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: #fbfaf8;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--purple);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(113, 75, 103, 0.09);
}
.help { color: var(--muted); font-size: 11px; line-height: 1.55; }
.field-error { color: var(--danger); font-size: 11px; font-weight: 750; }
.field-hint { color: var(--muted); font-size: 11px; line-height: 1.55; }
.helper-links { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.helper-links a { color: var(--purple); font-weight: 850; }
.errorlist { margin: 0; padding: 0; list-style: none; }
.form-alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.form-alert.error { color: var(--danger); border: 1px solid #f3c7cf; background: var(--danger-soft); }
.form-foot { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.form-foot a { color: var(--purple); font-weight: 850; }

.mini-steps { margin: 26px 0 0; padding: 0; display: grid; gap: 12px; list-style: none; }
.mini-steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.mini-steps li > span { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 50%; background: #fff; font-weight: 900; }
.mini-steps li > div { display: grid; gap: 2px; }
.mini-steps small { color: var(--muted); }
.mini-steps li.active { color: var(--purple); }
.mini-steps li.active > span { color: #fff; border-color: transparent; background: linear-gradient(145deg, var(--purple), var(--teal)); }
.mini-steps li.done > span { color: #fff; border-color: transparent; background: var(--green); }
.security-note { margin-top: 28px; padding: 16px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(1,126,132,.18); border-radius: 14px; background: var(--teal-soft); }
.security-note > span { color: var(--teal); }
.security-note div { display: grid; gap: 2px; }
.security-note small { color: var(--muted); }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 284px minmax(0, 1fr); background: var(--canvas); }
.portal-sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--border-soft);
  background: var(--sidebar);
}
.portal-sidebar > .brand { min-height: 58px; padding: 4px 7px 14px; border-bottom: 1px solid var(--border-soft); }
.portal-nav { margin-top: 18px; display: grid; gap: 4px; }
.portal-nav a { min-height: 45px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; border-radius: 11px; color: var(--muted); font-size: 13px; font-weight: 750; }
.portal-nav a:hover { color: var(--text); background: var(--canvas); }
.portal-nav a.active { color: var(--purple); background: var(--purple-soft); }
.nav-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: rgba(113,75,103,.06); font-weight: 900; }
.portal-nav a.active .nav-icon { color: #fff; background: var(--purple); }
.sidebar-spacer { flex: 1; }
.sidebar-account { min-width: 0; padding: 12px 9px; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--border-soft); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--purple), var(--teal)); font-weight: 900; }
.sidebar-account > span:last-child { min-width: 0; display: grid; gap: 2px; }
.sidebar-account strong, .sidebar-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 12px; }
.sidebar-account small { color: var(--muted); font-size: 9px; direction: ltr; }
.logout-button { width: 100%; min-height: 39px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 750; }
.logout-button:hover { color: var(--danger); border-color: rgba(180,35,59,.3); background: var(--danger-soft); }
.portal-main { min-width: 0; }
.portal-topbar { min-height: 64px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-soft); background: rgba(255,255,255,.9); backdrop-filter: blur(12px); }
.portal-topbar > div { display: flex; align-items: center; gap: 10px; }
.portal-topbar strong { font-size: 13px; }
.portal-topbar a { color: var(--purple); font-size: 11px; font-weight: 800; }

.toast-stack { width: min(620px, calc(100% - 32px)); position: fixed; z-index: 50; top: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; }
.customer-app .toast-stack { top: 76px; }
.toast { padding: 13px 16px; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: var(--shadow-soft); font-size: 12px; font-weight: 750; }
.toast.success { color: var(--green); border-color: #bce4d3; background: var(--green-soft); }
.toast.error { color: var(--danger); border-color: #f3c7cf; background: var(--danger-soft); }
.toast.warning { color: var(--amber); border-color: #ecd29d; background: var(--amber-soft); }

.dashboard-page, .onboarding-page { max-width: 1240px; margin: auto; padding: 34px 32px 56px; }
.page-heading { margin-bottom: 25px; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.page-heading h1 { margin: 6px 0 6px; font-size: 29px; letter-spacing: -0.02em; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.dashboard-heading { align-items: center; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.status-card { min-height: 192px; padding: 20px; border: 1px solid var(--border-soft); border-top: 3px solid #c8c3bc; border-radius: 16px; background: #fff; box-shadow: var(--shadow-soft); }
.status-card.ready:nth-child(1) { border-top-color: #25a66f; }
.status-card.ready:nth-child(2) { border-top-color: var(--teal); }
.status-card.ready:nth-child(3) { border-top-color: var(--purple); }
.status-card-top { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.status-icon, .panel-icon { display: grid; place-items: center; color: #fff; font-weight: 900; }
.status-icon { width: 40px; height: 40px; border-radius: 12px; }
.status-icon.whatsapp, .panel-icon.whatsapp { background: linear-gradient(145deg, #20b978, #12875a); }
.status-icon.odoo, .panel-icon.odoo { background: linear-gradient(145deg, var(--purple), #9a6e94); }
.status-icon.ai { background: linear-gradient(145deg, var(--teal), var(--purple)); font-size: 11px; }
.status-label { display: block; color: var(--muted); font-size: 11px; font-weight: 750; }
.status-card > strong { max-width: 100%; margin: 5px 0 8px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.status-card > p { min-height: 38px; margin: 0; overflow: hidden; color: var(--muted); font-size: 11.5px; line-height: 1.7; overflow-wrap: anywhere; }
.dashboard-grid, .onboarding-grid { margin-top: 15px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 15px; }
.panel { padding: 24px; border: 1px solid var(--border-soft); border-radius: 17px; background: #fff; box-shadow: var(--shadow-soft); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-heading h2 { margin: 5px 0 0; font-size: 22px; }
.progress-number { color: var(--purple); font-size: 25px; font-weight: 900; }
.progress-track { height: 9px; margin: 19px 0 23px; overflow: hidden; border-radius: 999px; background: var(--canvas); }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--teal)); transition: width .3s ease; }
.check-list { display: grid; gap: 6px; }
.check-list > div { min-height: 55px; padding: 9px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 11px; border-radius: 11px; }
.check-list > div:hover { background: var(--canvas); }
.check-list > div > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); font-weight: 900; }
.check-list > div.done > span { color: #fff; border-color: var(--green); background: var(--green); }
.check-list > div > div { display: grid; gap: 2px; }
.check-list small { color: var(--muted); }
.check-list a { color: var(--purple); font-size: 11px; font-weight: 850; }
.support-panel { position: relative; overflow: hidden; }
.support-panel::after { content: ""; width: 180px; height: 180px; position: absolute; left: -80px; bottom: -90px; border-radius: 50%; background: rgba(1,126,132,.07); }
.support-mark { width: 46px; height: 46px; margin-bottom: 22px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--purple), var(--teal)); font-weight: 900; }
.support-panel h2 { margin: 7px 0 9px; font-size: 21px; }
.support-panel p { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.waiting-note { padding: 11px 12px; display: flex; align-items: center; gap: 8px; border-radius: 10px; color: var(--amber); background: var(--amber-soft); font-size: 11px; font-weight: 850; }
.waiting-note.ready { color: var(--green); background: var(--green-soft); }
.waiting-note i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.onboarding-page { max-width: 1080px; }
.onboarding-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); }
.form-panel { text-align: center; }
.form-panel.align-start { text-align: start; }
.panel-icon { width: 48px; height: 48px; margin: 0 auto 17px; border-radius: 14px; }
.align-start .panel-icon { margin-inline: 0; }
.form-panel h2 { margin: 0 0 7px; font-size: 23px; }
.form-panel > p { margin: 0 auto 22px; color: var(--muted); line-height: 1.7; }
.align-start > p { margin-inline: 0; }
.form-panel form { max-width: 500px; margin: auto; }
.align-start form { max-width: none; }
.field.centered { justify-items: center; }
.field input.otp-input { width: min(100%, 310px); min-height: 62px; text-align: center; direction: ltr; letter-spacing: .42em; font-size: 26px; font-weight: 900; }
.resend-form { margin-top: 13px !important; }
.resend-form button { border: 0; color: var(--purple); background: transparent; font-size: 11px; font-weight: 850; }
.debug-code { margin: 0 auto 18px; padding: 13px; display: grid; gap: 3px; border: 1px dashed rgba(166,106,18,.35); border-radius: 11px; color: var(--amber); background: var(--amber-soft); }
.debug-code span, .debug-code small { font-size: 10px; }
.debug-code strong { direction: ltr; letter-spacing: .25em; font-size: 21px; }
.step-panel h3, .privacy-panel h3 { margin: 0; }
.privacy-panel { background: linear-gradient(160deg, #23131f, #0f3031); color: #fff; }
.shield-large { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: rgba(255,255,255,.1); }
.privacy-panel h3 { margin: 20px 0 17px; font-size: 21px; }
.privacy-panel ul { margin: 0; padding: 0; display: grid; gap: 15px; list-style: none; }
.privacy-panel li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,.78); font-size: 12px; line-height: 1.6; }
.privacy-panel li span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: rgba(255,255,255,.1); font-weight: 900; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; }
  .hero-preview { width: min(100%, 580px); margin: auto; transform: none; }
  .auth-layout, .auth-layout.compact { grid-template-columns: 1fr; gap: 30px; }
  .auth-aside { text-align: center; }
  .auth-aside .eyebrow { margin-inline: auto; }
  .auth-aside > p { margin-inline: auto; }
  .auth-aside .mini-steps, .security-note { max-width: 570px; margin-inline: auto; text-align: start; }
  .form-card.narrow { max-width: 560px; justify-self: center; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .status-card:last-child { grid-column: 1 / -1; }
  .dashboard-grid, .onboarding-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .public-nav { min-height: 62px; padding: 9px 15px; }
  .brand-copy small { display: none; }
  .public-actions .button { min-height: 40px; padding: 8px 11px; font-size: 12px; }
  .hero { min-height: auto; padding: 44px 17px 48px; }
  .hero h1 { font-size: 38px; }
  .hero-copy > p { font-size: 15px; }
  .hero-actions .button { width: 100%; }
  .feature-strip { grid-template-columns: 1fr; padding: 0 17px; }
  .auth-layout { min-height: auto; padding: 38px 17px; }
  .auth-aside h1 { font-size: 34px; }
  .form-card { padding: 23px 18px; border-radius: 18px; }
  .field-grid.two { grid-template-columns: 1fr; gap: 0; }
  .field input { font-size: 16px; }

  .portal-shell { display: block; padding-top: 122px; }
  .portal-sidebar { height: 122px; position: fixed; inset: 0 0 auto; z-index: 30; padding: 9px 13px; border: 0; border-bottom: 1px solid var(--border-soft); }
  .portal-sidebar > .brand { min-height: 48px; padding: 0 3px 8px; }
  .portal-sidebar .brand-mark { width: 34px; height: 34px; }
  .portal-nav { margin-top: 7px; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
  .portal-nav::-webkit-scrollbar { display: none; }
  .portal-nav a { min-width: max-content; min-height: 42px; padding: 8px 11px; }
  .sidebar-spacer, .sidebar-account, .portal-sidebar > form { display: none; }
  .portal-topbar { display: none; }
  .customer-app .toast-stack { top: 132px; }
  .dashboard-page, .onboarding-page { padding: 24px 16px 42px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 25px; }
  .status-grid { grid-template-columns: 1fr; }
  .status-card:last-child { grid-column: auto; }
  .panel { padding: 19px; }
}

@media (max-width: 480px) {
  .public-actions .button-ghost { display: none; }
  .hero h1 { font-size: 33px; }
  .hero-preview { border-radius: 18px; }
  .preview-step { grid-template-columns: 34px 1fr; }
  .preview-step b { display: none; }
  .trust-row { display: grid; }
  .page-heading { display: grid; }
  .page-heading > .pill { justify-self: start; }
  .check-list > div { grid-template-columns: 33px 1fr; }
  .check-list a { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Dashboard activity: this week's counters and the last few questions. */
.activity-panel .week-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.activity-panel .week-counters div {
  background: var(--surface-2, #f6f7fb);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.activity-panel .week-counters strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.2;
}
.activity-panel .week-counters small {
  color: var(--muted, #6b7280);
}
.activity-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.activity-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.activity-list li:last-child {
  border-bottom: 0;
}
.activity-when,
.activity-seconds {
  color: var(--muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.activity-channel {
  font-weight: 600;
}
.activity-seconds {
  margin-inline-start: auto;
}
.activity-note {
  color: var(--muted, #6b7280);
  font-size: 0.85rem;
}

/* Phone: a slim top bar and a bottom tab bar, like an installed app. */
@media (max-width: 760px) {
  .portal-shell { padding-top: calc(56px + env(safe-area-inset-top)); padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .portal-sidebar { height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0; display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
  .portal-sidebar > .brand { min-height: 0; padding: 0; }
  .portal-sidebar > form { display: block; margin: 0; }
  .portal-sidebar .logout-button { width: auto; min-height: 36px; padding: 6px 12px; }
  .portal-nav { position: fixed; inset: auto 0 0 0; z-index: 30; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; overflow: visible; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-soft); background: var(--sidebar); }
  .portal-nav a { min-width: 0; min-height: 54px; padding: 5px 2px; flex-direction: column; justify-content: center; gap: 3px; font-size: 10.5px; text-align: center; }
  .portal-nav a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portal-nav .nav-wide { display: none; }
  .customer-app .toast-stack { top: calc(66px + env(safe-area-inset-top)); }
}
