:root {
  color-scheme: light;
  --ink: #122521;
  --muted: #64736f;
  --line: #dfe8e5;
  --surface: #ffffff;
  --canvas: #f3f7f5;
  --teal: #0d766e;
  --teal-dark: #075a54;
  --teal-soft: #e4f4ef;
  --gold: #c7811d;
  --gold-soft: #fff4df;
  --navy: #19334d;
  --shadow: 0 24px 70px rgba(18, 55, 47, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 750; letter-spacing: -0.01em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #fff; background: var(--teal); box-shadow: 0 8px 24px rgba(13, 118, 110, 0.2); }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 13px; font-weight: 760; border: 1px solid transparent; transition: transform 160ms ease, background 160ms ease, border 160ms ease; }
.primary-button { color: #fff; background: var(--teal); box-shadow: 0 10px 26px rgba(13, 118, 110, 0.22); }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.primary-button.small { min-height: 40px; padding: 0 14px; font-size: 13px; }
.secondary-button { color: var(--ink); background: #fff; border-color: var(--line); }
.secondary-button:hover { border-color: #9db8b1; transform: translateY(-1px); }
.online-dot, .pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2dac71; box-shadow: 0 0 0 4px rgba(45, 172, 113, 0.12); }

/* Customer landing */
.landing-body { min-height: 100vh; background: radial-gradient(circle at 100% 0, #d8f0e8 0, transparent 31%), linear-gradient(180deg, #f8fbfa 0%, #eff6f3 100%); padding-bottom: 112px; }
.landing-header { display: flex; align-items: center; justify-content: space-between; width: min(100% - 32px, 720px); margin: 0 auto; padding: 22px 0; }
.secure-chip, .merchant-pill, .demo-badge, .subtle-chip, .status-chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.secure-chip { padding: 7px 10px; color: var(--teal-dark); background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(13, 118, 110, 0.12); }
.landing-main { width: min(100% - 32px, 720px); margin: 0 auto; }
.hero-card { position: relative; overflow: hidden; padding: 30px 26px 27px; border: 1px solid rgba(13, 118, 110, 0.1); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.86); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.hero-card::after { position: absolute; right: -56px; top: -72px; width: 180px; height: 180px; content: ""; border-radius: 50%; background: linear-gradient(145deg, rgba(13, 118, 110, 0.18), rgba(13, 118, 110, 0)); }
.merchant-pill { position: relative; z-index: 1; margin-bottom: 26px; padding: 8px 12px; color: var(--teal-dark); background: var(--teal-soft); }
.hero-card h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(34px, 8.4vw, 56px); line-height: 1.08; letter-spacing: -0.055em; }
.hero-card h1 span { color: var(--teal); }
.hero-copy { position: relative; z-index: 1; max-width: 540px; margin: 18px 0 26px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.hero-proof { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 20px; border-top: 1px solid var(--line); }
.hero-proof span { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.hero-proof strong { color: var(--ink); font-size: 15px; }
.section-block { padding: 44px 4px 20px; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -0.035em; }
.benefit-list { display: grid; gap: 12px; margin-top: 20px; }
.benefit-item { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.72); }
.benefit-item h3 { margin: 1px 0 6px; font-size: 16px; }
.benefit-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.step-number { display: grid; flex: 0 0 40px; height: 40px; place-items: center; border-radius: 12px; color: var(--teal); background: var(--teal-soft); font-size: 12px; font-weight: 850; }
.lead-card { margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 14px 36px rgba(18, 55, 47, 0.07); }
.lead-card .section-heading > p:last-child { margin: 8px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.lead-card form { display: grid; gap: 10px; }
.field-label { margin-top: 5px; font-size: 13px; font-weight: 720; }
.lead-card input[type="tel"], .lead-card select { width: 100%; min-height: 48px; padding: 0 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; font: inherit; }
.lead-card input:focus, .lead-card select:focus { border-color: var(--teal); outline: 3px solid rgba(13, 118, 110, 0.12); }
.consent-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: flex-start; margin: 8px 0 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.consent-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--teal); }
.lead-submit { width: 100%; min-height: 50px; }
.lead-submit:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.form-status { min-height: 20px; margin: 0; color: var(--teal-dark); font-size: 12px; text-align: center; }
.trust-panel { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding: 18px; color: #d9ece8; border-radius: var(--radius-md); background: var(--navy); }
.trust-icon { display: grid; flex: 0 0 40px; height: 40px; place-items: center; border-radius: 12px; color: #fff; background: rgba(255, 255, 255, 0.12); font-size: 12px; font-weight: 800; }
.trust-panel strong { color: #fff; font-size: 14px; }
.trust-panel p { margin: 6px 0 0; font-size: 12px; line-height: 1.6; }
.sticky-cta { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px max(18px, calc((100vw - 688px) / 2)); border-top: 1px solid rgba(18, 37, 33, 0.08); background: rgba(255, 255, 255, 0.9); box-shadow: 0 -12px 36px rgba(18, 55, 47, 0.09); backdrop-filter: blur(18px); }
.sticky-cta .primary-button { min-width: 170px; }
.cta-note { display: flex; align-items: center; gap: 11px; }
.cta-note > span:last-child { display: grid; gap: 2px; }
.cta-note strong { font-size: 13px; }
.cta-note small { color: var(--muted); font-size: 11px; }
.toast { position: fixed; z-index: 30; right: 18px; bottom: 92px; display: flex; gap: 12px; width: min(calc(100vw - 36px), 390px); padding: 16px; border: 1px solid rgba(13, 118, 110, 0.15); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }
.toast-icon { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); }
.toast strong { font-size: 14px; }
.toast p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* Merchant dashboard */
.dashboard-body { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 246px; padding: 26px 18px 18px; color: #dcebe7; background: #102923; }
.dashboard-brand { padding: 0 10px; color: #fff; }
.dashboard-brand .brand-mark { color: var(--teal-dark); background: #b9eee0; box-shadow: none; }
.side-nav { display: grid; gap: 6px; margin-top: 42px; }
.side-nav a { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 12px; color: #91aaa3; font-size: 13px; font-weight: 650; }
.side-nav a span { width: 20px; color: #b6ccc6; text-align: center; }
.side-nav a:hover, .side-nav a.active { color: #fff; background: rgba(255, 255, 255, 0.09); }
.sidebar-help { display: flex; gap: 11px; align-items: flex-start; margin-top: auto; padding: 14px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; background: rgba(255, 255, 255, 0.045); }
.sidebar-help > span { display: grid; flex: 0 0 24px; height: 24px; place-items: center; border-radius: 50%; color: #092921; background: #b9eee0; font-weight: 800; }
.sidebar-help strong { color: #fff; font-size: 11px; }
.sidebar-help p { margin: 4px 0 0; color: #91aaa3; font-size: 10px; line-height: 1.45; }
.sidebar-profile { display: flex; align-items: center; gap: 11px; margin-top: 14px; padding: 14px 10px 2px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.profile-avatar { display: grid; flex: 0 0 36px; height: 36px; place-items: center; border-radius: 12px; color: var(--teal-dark); background: #d9f6ee; font-weight: 850; }
.sidebar-profile > span:last-child { display: grid; gap: 2px; }
.sidebar-profile strong { color: #fff; font-size: 12px; }
.sidebar-profile small { color: #7d9a92; font-size: 10px; }
.dashboard-main { width: calc(100% - 246px); margin-left: 246px; padding: 42px clamp(24px, 4vw, 56px) 60px; }
.dashboard-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.dashboard-header h1 { margin: 0; font-size: clamp(29px, 3.2vw, 42px); letter-spacing: -0.045em; }
.dashboard-header p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.demo-badge { padding: 9px 12px; color: var(--teal-dark); background: var(--teal-soft); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; overflow: hidden; min-height: 154px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.metric-card::after { position: absolute; right: -42px; bottom: -50px; width: 110px; height: 110px; content: ""; border-radius: 50%; background: rgba(13, 118, 110, 0.035); }
.metric-card.accent-teal { color: #fff; border-color: transparent; background: var(--teal); }
.metric-card.accent-teal::after { background: rgba(255, 255, 255, 0.08); }
.metric-card.accent-gold { border-color: #efd9ae; background: var(--gold-soft); }
.metric-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 720; }
.metric-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; font-weight: 850; }
.accent-teal .metric-icon { color: #fff; background: rgba(255, 255, 255, 0.14); }
.accent-gold .metric-icon { color: #8e5a0d; background: #ffe8bd; }
.metric-card > strong { position: relative; z-index: 1; display: block; margin-top: 18px; font-size: 32px; letter-spacing: -0.04em; }
.metric-card > p { position: relative; z-index: 1; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.accent-teal > p { color: #c5e5de; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr); gap: 14px; margin-top: 14px; }
.lower-columns { grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr); }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.panel-heading h2 { margin: 0; font-size: 19px; letter-spacing: -0.025em; }
.subtle-chip { padding: 7px 10px; color: var(--muted); background: var(--canvas); }
.status-chip { padding: 7px 10px; color: var(--teal-dark); background: var(--teal-soft); }
.course-interest-panel { margin-top: 14px; }
.course-interest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; }
.course-interest-row { display: grid; grid-template-columns: minmax(76px, auto) minmax(60px, 1fr) 48px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.course-interest-row:nth-child(-n + 2) { padding-top: 0; border-top: 0; }
.course-interest-row > strong { min-width: 0; font-size: 12px; }
.course-interest-track { overflow: hidden; height: 9px; border-radius: 999px; background: #edf2f0; }
.course-interest-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #35aa98); transition: width 380ms ease; }
.course-interest-count { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }
.funnel-row { display: grid; grid-template-columns: 105px 1fr 44px; gap: 13px; align-items: center; margin-top: 18px; }
.funnel-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.funnel-row strong { font-size: 13px; }
.funnel-row small { color: var(--muted); font-size: 11px; text-align: right; }
.funnel-track { overflow: hidden; height: 9px; border-radius: 999px; background: #edf2f0; }
.funnel-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--teal); transition: width 380ms ease; }
.fill-scans { width: 100%; }
.funnel-row.muted { opacity: 0.55; }
.qr-content { display: flex; gap: 20px; align-items: center; }
.qr-frame { flex: 0 0 146px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 12px 28px rgba(17, 52, 44, 0.08); }
.qr-frame img { display: block; width: 100%; aspect-ratio: 1; }
.qr-details { min-width: 0; }
.qr-details > strong { display: block; font-size: 16px; }
.qr-details > p { margin: 5px 0 10px; color: var(--muted); font-size: 12px; }
.qr-details code { display: inline-block; padding: 5px 8px; border-radius: 7px; color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.qr-actions .secondary-button { min-height: 40px; padding: 0 13px; font-size: 13px; }
.qr-actions .small-link { min-height: 40px; padding: 0 13px; font-size: 13px; }
.qr-tip { margin: 20px 0 0; padding-top: 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; line-height: 1.55; }
.data-time { color: var(--muted); font-size: 11px; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { padding-top: 0; border-top: 0; }
.activity-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; font-weight: 850; }
.activity-item strong { display: block; font-size: 12px; }
.activity-item p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.activity-item time { color: var(--muted); font-size: 10px; }
.empty-state { display: grid; min-height: 168px; place-items: center; color: var(--muted); border: 1px dashed #cddbd7; border-radius: 13px; font-size: 12px; }
.reconciliation-panel { margin-top: 14px; }
.reconciliation-help { margin: -12px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.reward-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reward-item { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfc; }
.reward-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.reward-heading > div:first-child { min-width: 0; }
.reward-heading strong, .reward-heading small { display: block; }
.reward-heading strong { font-size: 13px; }
.reward-heading small { overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reward-amount { flex: 0 0 auto; text-align: right; }
.reward-amount strong { font-size: 17px; }
.reward-amount span { display: block; margin-top: 4px; color: var(--teal-dark); font-size: 10px; }
.reward-cancelled .reward-amount, .reward-cancelled { opacity: 0.62; }
.reward-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.reward-facts span { min-width: 0; }
.reward-facts small, .reward-facts b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reward-facts small { color: var(--muted); font-size: 9px; }
.reward-facts b { margin-top: 4px; font-size: 10px; }
.rule-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 12px; }
.rule-row:first-of-type { border-top: 0; }
.rule-row span { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.rule-row strong { font-size: 11px; text-align: right; }
.rule-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa7a3; }
.rule-dot.teal { background: var(--teal); }
.rule-dot.gold { background: var(--gold); }
.rule-dot.navy { background: var(--navy); }
.rule-notice { margin-top: 12px; padding: 14px; border-radius: 13px; color: #78500f; background: var(--gold-soft); }
.rule-notice strong { font-size: 12px; }
.rule-notice p { margin: 5px 0 0; font-size: 10px; line-height: 1.55; }
.dashboard-toast { bottom: 22px; }
.merchant-login { min-height: 100vh; padding: 24px; place-items: center; background: linear-gradient(145deg, #0d2822, #174b40); }
.merchant-login:not([hidden]) { display: grid; }
.merchant-login form { display: grid; width: min(420px, 100%); gap: 16px; padding: 32px; border-radius: 24px; background: #fff; box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24); }
.merchant-login h1, .merchant-login p { margin: 0; }
.merchant-login label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.merchant-login input { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; }
.merchant-login .primary-button { border: 0; cursor: pointer; }
.merchant-login [role="status"] { min-height: 20px; color: #a33; font-size: 12px; }
.merchant-auth-required .sidebar, .merchant-auth-required .dashboard-main { display: none; }

/* A5 print advertisement preview */
.print-body { min-height: 100vh; padding: 28px; background: #dfe8e4; }
.print-sheet { position: relative; display: flex; flex-direction: column; width: 148mm; min-height: 210mm; margin: 0 auto; overflow: hidden; color: #102923; background: #fbfdfc; box-shadow: 0 24px 70px rgba(18, 55, 47, 0.18); }
.print-sheet::before { position: absolute; top: -32mm; right: -31mm; width: 88mm; height: 88mm; content: ""; border-radius: 50%; background: #dff2ec; }
.print-sheet::after { position: absolute; bottom: -33mm; left: -36mm; width: 78mm; height: 78mm; content: ""; border-radius: 50%; background: #edf6f3; }
.print-inner { position: relative; z-index: 1; display: flex; flex: 1; flex-direction: column; padding: 15mm 14mm 10mm; }
.print-header { display: flex; align-items: center; justify-content: space-between; }
.print-brand { display: inline-flex; align-items: center; gap: 3mm; font-size: 4mm; font-weight: 820; }
.print-brand-mark { display: grid; width: 9mm; height: 9mm; place-items: center; border-radius: 3mm; color: #fff; background: var(--teal); font-size: 3.4mm; }
.print-preview-chip { padding: 2mm 3mm; border: 0.3mm solid #b7d6ce; border-radius: 99mm; color: var(--teal-dark); background: rgba(255, 255, 255, 0.65); font-size: 2.5mm; font-weight: 760; }
.print-copy { max-width: 120mm; margin-top: 17mm; }
.print-merchant { display: inline-flex; align-items: center; gap: 2mm; padding: 2.2mm 3.3mm; border-radius: 99mm; color: var(--teal-dark); background: var(--teal-soft); font-size: 2.8mm; font-weight: 760; }
.print-copy h1 { margin: 5mm 0 4mm; font-size: 10.8mm; line-height: 1.06; letter-spacing: -0.06em; }
.print-copy h1 .print-title-line { display: block; color: inherit; white-space: nowrap; }
.print-copy h1 .print-title-line.accent { color: var(--teal); }
.print-copy > p { max-width: 100mm; margin: 0; color: #566b65; font-size: 4mm; line-height: 1.65; }
.print-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; margin-top: 9mm; }
.print-benefit { padding: 4mm; border: 0.3mm solid #d9e6e2; border-radius: 4mm; background: rgba(255, 255, 255, 0.78); }
.print-benefit strong { display: block; font-size: 3.5mm; }
.print-benefit span { display: block; margin-top: 1.4mm; color: #667771; font-size: 2.7mm; line-height: 1.45; }
.print-qr-zone { display: grid; grid-template-columns: 46mm 1fr; gap: 8mm; align-items: center; margin-top: auto; padding: 7mm; border-radius: 6mm; color: #fff; background: #12382f; }
.print-qr-frame { padding: 3mm; border-radius: 4mm; background: #fff; }
.print-qr-frame img { display: block; width: 40mm; height: 40mm; }
.print-qr-copy small { color: #a8d4c9; font-size: 2.7mm; font-weight: 750; letter-spacing: 0.08em; }
.print-qr-copy h2 { margin: 2mm 0 2mm; font-size: 7mm; line-height: 1.18; letter-spacing: -0.045em; }
.print-qr-copy p { margin: 0; color: #c9ddd8; font-size: 3mm; line-height: 1.55; }
.print-qr-copy strong { display: inline-block; margin-top: 3mm; padding: 2mm 3mm; border-radius: 99mm; color: #0f4035; background: #c9f2e7; font-size: 3mm; }
.print-footer { display: flex; justify-content: space-between; gap: 6mm; margin-top: 5mm; color: #74837f; font-size: 2.35mm; }
.print-footer strong { color: #425852; }
.print-actions { display: flex; justify-content: center; gap: 10px; margin: 18px auto 0; }

@page { size: A5 portrait; margin: 0; }

@media print {
  .print-body { padding: 0; background: #fff; }
  .print-sheet { margin: 0; box-shadow: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-actions { display: none; }
}

@media (max-width: 1040px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-columns, .lower-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 16px; }
  .dashboard-brand { padding: 0; }
  .side-nav { grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { justify-content: center; min-width: 94px; padding: 10px 8px; font-size: 11px; }
  .side-nav a span { display: none; }
  .sidebar-help, .sidebar-profile { display: none; }
  .dashboard-main { width: 100%; margin: 0; padding: 26px 16px 44px; }
  .dashboard-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; justify-content: space-between; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 142px; padding: 17px; }
  .metric-card > strong { font-size: 27px; }
  .course-interest-list { grid-template-columns: 1fr; }
  .course-interest-row:nth-child(2) { padding-top: 12px; border-top: 1px solid var(--line); }
  .qr-content { align-items: flex-start; }
  .qr-frame { flex-basis: 124px; }
  .reward-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .landing-header { padding-top: 16px; }
  .secure-chip { font-size: 10px; }
  .hero-card { padding: 25px 20px 23px; border-radius: 23px; }
  .hero-proof { grid-template-columns: 1fr; gap: 12px; }
  .hero-proof span { grid-template-columns: 76px 1fr; align-items: center; }
  .sticky-cta { padding: 12px 16px; }
  .sticky-cta .primary-button { min-width: 152px; padding: 0 14px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 132px; padding: 15px; }
  .metric-card > strong { margin-top: 14px; font-size: 24px; }
  .dashboard-columns { gap: 10px; margin-top: 10px; }
  .panel { padding: 18px; }
  .panel-heading { margin-bottom: 18px; }
  .course-interest-panel { margin-top: 10px; }
  .course-interest-row { grid-template-columns: 76px minmax(50px, 1fr) 44px; gap: 9px; }
  .subtle-chip { display: none; }
  .funnel-row { grid-template-columns: 94px 1fr 38px; gap: 9px; }
  .qr-content { display: grid; grid-template-columns: 112px 1fr; gap: 14px; }
  .qr-frame { width: 112px; }
  .qr-actions { grid-column: 1 / -1; }
  .reconciliation-panel { margin-top: 10px; }
  .reward-heading { gap: 8px; }
  .reward-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .print-body { padding: 0; overflow-x: auto; }
  .print-sheet { transform-origin: top left; }
}

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

/* CRM parent activity page reused for merchant-attributed acquisition */
.parent-activity-body {
  --activity-red: #c62836;
  --activity-red-dark: #9c1e25;
  --activity-gold: #d79d35;
  --activity-navy: #161b2b;
  min-height: 100vh;
  padding-bottom: 104px;
  background: #fff2d9;
}
.parent-activity { width: min(100%, 460px); margin: 0 auto; }
.activity-visual { position: relative; overflow: hidden; background: #fff2d9; }
.activity-visual > img { display: block; width: 100%; height: auto; }
.hero-course-hotspots { position: absolute; inset: 0; }
.hero-course-hotspots a { position: absolute; right: 8%; left: 8%; height: 7.6%; border-radius: 14px; touch-action: manipulation; }
.hero-course-hotspots a:hover { background: rgba(255, 255, 255, 0.08); }
.hero-course-hotspots a:focus-visible { outline: 4px solid #fff; outline-offset: -4px; box-shadow: 0 0 0 7px rgba(198, 40, 54, 0.72); }
.hotspot-drone { top: 46.7%; }
.hotspot-ai { top: 54.6%; }
.hotspot-printing { top: 62.5%; }
.hotspot-steam { top: 70.4%; }
.hotspot-embodied { top: 78.3%; }
.hero-course-hotspots .hotspot-all { top: 92.6%; right: 22%; left: 22%; height: 6.2%; border-radius: 999px; }
.activity-partner-bar {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 222, 157, 0.56);
  border-radius: 12px;
  color: #fff8e7;
  background: rgba(22, 27, 43, 0.9);
  box-shadow: 0 9px 24px rgba(63, 26, 14, 0.25);
  backdrop-filter: blur(10px);
}
.activity-partner-bar strong {
  overflow: hidden;
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.official-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #3d220d;
  background: #f2c76d;
  font-size: 10px;
  font-weight: 850;
}
.activity-form-card {
  position: relative;
  z-index: 2;
  width: calc(100% - 30px);
  margin: 14px auto 18px;
  padding: 24px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(91, 38, 8, 0.27);
}
.consultation-card {
  position: relative;
  z-index: 2;
  width: calc(100% - 30px);
  margin: 14px auto 0;
  padding: 24px;
  border: 1px solid rgba(215, 177, 93, 0.72);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 18px 55px rgba(91, 38, 8, 0.18);
}
.consultation-card .section-heading h1 { margin: 0; color: var(--activity-red-dark); font-size: 25px; letter-spacing: -0.03em; }
.consultation-card .section-heading > p:last-child { margin: 8px 0 18px; color: #6f7889; font-size: 13px; line-height: 1.6; }
.consultation-options { display: grid; gap: 10px; }
.consultation-option {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid #e2d8c5;
  border-radius: 12px;
  color: #273248;
  background: #fff;
  text-align: left;
  box-shadow: none;
}
.consultation-option:hover { border-color: #d7a23d; transform: translateY(-1px); }
.consultation-option[aria-disabled="true"] { opacity: 0.58; }
.channel-label {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--activity-red);
  font-size: 11px;
  font-weight: 900;
}
.bot-option .channel-label { background: #6043aa; }
.phone-option .channel-label { background: #9a6416; }
.consultation-option > span:last-child { display: grid; gap: 4px; }
.consultation-option strong { font-size: 14px; }
.consultation-option small { color: #778096; font-size: 11px; }
.channel-status { min-height: 18px; margin: 11px 0 0; color: var(--activity-red-dark); font-size: 11px; line-height: 1.5; text-align: center; }
.activity-form-card .eyebrow { margin-bottom: 8px; color: #a56413; letter-spacing: 0; }
.activity-form-card .section-heading h1 { margin: 0; color: var(--activity-red-dark); font-size: 25px; letter-spacing: -0.03em; }
.activity-form-card .section-heading > p:last-child { margin: 8px 0 20px; color: #6f7889; }
.activity-form-card .field-label { color: #394258; }
.activity-form-card input[type="tel"], .activity-form-card select { border-color: #d8dde8; border-radius: 8px; background: #fff; }
.activity-form-card input:focus, .activity-form-card select:focus { border-color: var(--activity-red); outline-color: rgba(198, 40, 54, 0.14); }
.activity-form-card .consent-row input { accent-color: var(--activity-red); }
.activity-form-card .consent-row a { color: var(--activity-red-dark); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.activity-form-card .primary-button, .activity-sticky-cta .primary-button { border-radius: 8px; background: var(--activity-red); box-shadow: 0 10px 24px rgba(198, 40, 54, 0.23); }
.activity-form-card .primary-button:hover, .activity-sticky-cta .primary-button:hover { background: var(--activity-red-dark); }
.activity-form-card .form-status { color: var(--activity-red-dark); }
.activity-promise {
  display: grid;
  gap: 6px;
  width: calc(100% - 30px);
  margin: 0 auto 28px;
  padding: 18px;
  border: 1px solid #d7b15d;
  border-radius: 16px;
  color: #734814;
  background: rgba(255, 251, 239, 0.78);
  text-align: center;
}
.activity-promise strong { color: var(--activity-red-dark); font-size: 17px; }
.activity-promise span { font-size: 12px; font-weight: 800; }
.activity-promise small { color: #7a6b58; font-size: 10px; line-height: 1.55; }
.activity-sticky-cta {
  padding-right: max(16px, calc((100vw - 430px) / 2));
  padding-left: max(16px, calc((100vw - 430px) / 2));
  border-top-color: rgba(138, 91, 24, 0.18);
  background: rgba(255, 250, 238, 0.94);
  box-shadow: 0 -12px 32px rgba(91, 38, 8, 0.12);
}
.activity-sticky-cta .primary-button { min-width: 142px; }
.activity-toast { border-color: rgba(198, 40, 54, 0.18); }
.activity-toast .toast-icon { background: var(--activity-red); }

.course-entry-section {
  width: calc(100% - 30px);
  margin: 14px auto 0;
  padding: 22px 18px;
  border: 1px solid rgba(215, 177, 93, 0.72);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 18px 55px rgba(91, 38, 8, 0.16);
}
.course-entry-heading h1 { margin: 0; color: var(--activity-red-dark); font-size: 24px; letter-spacing: -0.03em; }
.course-entry-heading > p:last-child { margin: 8px 0 17px; color: #6f7889; font-size: 12px; line-height: 1.6; }
.course-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.course-entry-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 142px;
  overflow: hidden;
  border: 1px solid #e2d8c5;
  border-radius: 13px;
  color: #fff;
  background: #1b2741;
  box-shadow: 0 8px 18px rgba(41, 26, 19, 0.12);
}
.course-entry-card::after { position: absolute; inset: 38% 0 0; content: ""; background: linear-gradient(transparent, rgba(14, 17, 31, 0.96)); }
.course-entry-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.course-entry-card > span:not(.course-entry-symbol) { position: relative; z-index: 1; align-self: end; display: grid; gap: 3px; padding: 62px 32px 13px 12px; }
.course-entry-card strong { font-size: 15px; }
.course-entry-card small { color: #f6d893; font-size: 10px; }
.course-entry-card > b { position: absolute; z-index: 2; right: 12px; bottom: 18px; font-size: 23px; line-height: 1; }
.course-entry-card:hover, .course-entry-card:focus-visible { border-color: #d7a23d; transform: translateY(-1px); outline: none; box-shadow: 0 0 0 3px rgba(215, 162, 61, 0.2), 0 10px 22px rgba(41, 26, 19, 0.16); }
.course-entry-symbol { position: absolute; top: 18px; left: 12px; z-index: 1; display: grid; min-width: 48px; min-height: 38px; place-items: center; padding: 4px 8px; border-radius: 10px; color: #2f1d09; background: #f2c76d; font-size: 11px; font-weight: 900; }
.full-course-entry { background: radial-gradient(circle at 84% 10%, #e44a3b 0, transparent 36%), linear-gradient(145deg, #781e2a, #1c213b); }
.embodied-entry { background: radial-gradient(circle at 80% 16%, #327ac4 0, transparent 36%), linear-gradient(145deg, #1a304f, #14192c); }

.course-detail-body { padding-bottom: 92px; }
.course-detail { width: min(100%, 460px); min-height: 100vh; margin: 0 auto; background: #fff2d9; box-shadow: 0 0 80px rgba(91, 38, 8, 0.1); }
.course-detail-nav { position: sticky; z-index: 24; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 10px 12px; color: #fff; background: rgba(22, 27, 43, 0.97); box-shadow: 0 8px 24px rgba(13, 16, 32, 0.2); backdrop-filter: blur(12px); }
.course-back-button { cursor: pointer; }
.course-detail-nav .course-back-button { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 13px; border: 1px solid rgba(255, 222, 157, 0.72); border-radius: 11px; color: #fff; background: #c62836; box-shadow: 0 7px 18px rgba(198, 40, 54, 0.34); font-size: 13px; font-weight: 850; }
.course-detail-nav .course-back-button:hover { background: #e13b43; }
.course-detail-nav .course-back-button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 226, 164, 0.42), 0 7px 18px rgba(198, 40, 54, 0.34); }
.course-back-button > span { font-size: 19px; line-height: 1; }
.back-hint { animation: back-hint 1.15s ease-in-out 3 0.45s; }
@keyframes back-hint {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(-7px); }
}
.course-detail-nav strong { font-size: 13px; }
.course-detail-hero { position: relative; min-height: 310px; overflow: hidden; background: #14192c; }
.course-detail-hero::after { position: absolute; inset: 30% 0 0; content: ""; background: linear-gradient(transparent, rgba(15, 17, 31, 0.96)); }
.course-detail-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.course-detail-overlay { position: absolute; z-index: 2; right: 20px; bottom: 22px; left: 20px; color: #fff; }
.course-detail-overlay > span { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: #3d220d; background: #f2c76d; font-size: 11px; font-weight: 900; }
.course-detail-overlay h1 { margin: 10px 0 6px; font-size: 36px; letter-spacing: -0.04em; }
.course-detail-overlay p { margin: 0; color: #e8ebf2; font-size: 13px; line-height: 1.65; }
.course-detail-card, .course-poster-section { width: calc(100% - 30px); margin: 14px auto 0; padding: 22px 18px; border: 1px solid rgba(215, 177, 93, 0.72); border-radius: 18px; background: #fffdf8; box-shadow: 0 14px 38px rgba(91, 38, 8, 0.14); }
.course-detail-card h2, .course-poster-section h2 { margin: 0; color: var(--activity-red-dark); font-size: 22px; letter-spacing: -0.03em; }
.course-highlight-list { display: grid; gap: 10px; margin-top: 17px; }
.course-highlight-list > div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; min-height: 54px; padding: 9px 11px; border: 1px solid #eadfc8; border-radius: 12px; background: #fff9ec; }
.course-highlight-list b { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #fff; background: var(--activity-red); font-size: 12px; }
.course-highlight-list span { color: #354056; font-size: 13px; font-weight: 720; line-height: 1.45; }
.course-note { margin: 16px 0 0; padding: 13px; border-radius: 10px; color: #70440d; background: #fff0c9; font-size: 12px; line-height: 1.65; }
.course-poster-section { padding: 18px 12px 12px; }
.course-poster-section h2 { margin: 2px 6px 14px; }
.course-poster-section > img { display: block; width: 100%; height: auto; border-radius: 12px; }
.course-poster-section[hidden] { display: none; }
.course-context-status { width: calc(100% - 30px); min-height: 18px; margin: 13px auto 20px; color: #76532b; font-size: 11px; text-align: center; }
.course-sticky-cta { justify-content: center; }
.course-sticky-cta .secondary-button, .course-sticky-cta .primary-button { flex: 1; max-width: 210px; min-width: 0; }
.course-sticky-cta .secondary-button { border-color: #c62836; color: #9c1e25; background: #fffdf8; font-weight: 850; }

@media (min-width: 820px) {
  .parent-activity-body { background: linear-gradient(90deg, #fff2d9 0%, #f9e6c0 50%, #fff2d9 100%); }
  .parent-activity { box-shadow: 0 0 80px rgba(91, 38, 8, 0.1); }
}

@media (max-width: 480px) {
  .activity-partner-bar { right: 10px; bottom: 10px; left: 10px; }
  .activity-form-card { padding: 22px 20px; }
  .activity-sticky-cta { padding: 10px 14px; }
  .course-entry-section { padding: 20px 14px; }
  .course-detail-hero { min-height: 290px; }
}

/* Merchant portal aligned with the existing COOLALA CRM visual system */
.dashboard-body {
  --ink: #1c2743;
  --muted: #69768c;
  --line: #e7e0d4;
  --surface: #fffdf8;
  --canvas: #f7f0e3;
  --teal: #c62836;
  --teal-dark: #9c1e25;
  --teal-soft: #fff0e8;
  --gold: #e3a83b;
  --gold-soft: #fff4d6;
  --navy: #161a2d;
  background: radial-gradient(circle at 88% 0%, rgba(243, 210, 137, 0.38), transparent 28rem), var(--canvas);
}
.dashboard-body .sidebar {
  color: #d9dfed;
  background: linear-gradient(180deg, #161a2d 0%, #111426 100%);
  box-shadow: 12px 0 35px rgba(13, 16, 32, 0.11);
}
.dashboard-body .dashboard-brand { align-items: flex-start; color: #fff; line-height: 1.35; }
.dashboard-body .dashboard-brand .brand-mark,
.dashboard-body .merchant-login .brand-mark {
  color: #fff8e7;
  background: linear-gradient(145deg, #c62836, #e24332);
  box-shadow: 0 8px 24px rgba(198, 40, 54, 0.28);
}
.dashboard-body .side-nav a { color: #aeb8ca; }
.dashboard-body .side-nav a span { color: #e3a83b; font-size: 9px; font-weight: 900; letter-spacing: 0.08em; }
.dashboard-body .side-nav a:hover { color: #fff; background: #222941; }
.dashboard-body .side-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, #cd2435, #ea4b32);
  box-shadow: 0 8px 20px rgba(194, 41, 50, 0.24);
}
.dashboard-body .side-nav a.active span { color: #ffe1a5; }
.dashboard-body .sidebar-help { border-color: #343b58; background: rgba(255, 255, 255, 0.04); }
.dashboard-body .sidebar-help > span { color: #34220f; background: #f0b44f; }
.dashboard-body .sidebar-help p, .dashboard-body .sidebar-profile small { color: #929db5; }
.dashboard-body .sidebar-profile { border-top-color: #343b58; }
.dashboard-body .profile-avatar { color: #fff6db; background: #752631; }
.dashboard-body .eyebrow { color: #a56413; }
.dashboard-body .demo-badge { color: #7a4a0f; background: #fff0c7; }
.dashboard-body .online-dot { background: #d73538; box-shadow: 0 0 0 4px rgba(215, 53, 56, 0.12); }
.dashboard-body .metric-card,
.dashboard-body .panel { box-shadow: 0 10px 26px rgba(24, 34, 58, 0.06); }
.dashboard-body .metric-card.accent-teal {
  background: linear-gradient(120deg, #a91f2b, #df3b35);
}
.dashboard-body .metric-card.accent-gold { border-color: #e5bd6a; background: #fff4d6; }
.dashboard-body .metric-icon { color: #9c1e25; background: #fff0e8; }
.dashboard-body .accent-gold .metric-icon { color: #734814; background: #f7d88f; }
.dashboard-body .funnel-fill { background: linear-gradient(90deg, #c62836, #e3a83b); }
.dashboard-body .qr-frame { border-color: #e0bd76; box-shadow: 0 12px 28px rgba(91, 38, 8, 0.11); }
.dashboard-body .qr-details code { color: #9c1e25; background: #fff0e8; }
.dashboard-body .status-chip { color: #74450c; background: #fff0c7; }
.dashboard-body .activity-icon { color: #9c1e25; background: #fff0e8; }
.dashboard-body .rule-notice { color: #734814; background: #fff4d6; }
.dashboard-body .merchant-login {
  background: radial-gradient(circle at 75% 10%, rgba(198, 40, 54, 0.42), transparent 22rem), linear-gradient(145deg, #111426, #202944);
}
