:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #14213d;
  --muted: #64748b;
  --line: #dbe3ef;
  --blue: #1e3a8a;
  --orange: #f97316;
  --green: #059669;
  --rose: #e11d48;
  --shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

[data-theme="dark"] {
  --bg: #101522;
  --panel: #151c2c;
  --ink: #edf2ff;
  --muted: #9aa8bd;
  --line: #263247;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.topbar { height: 76px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 5vw; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.brand, .top-actions, .main-nav { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--orange)); color: white; font-weight: 900; }
.brand-mark.small { width: 34px; height: 34px; font-size: 13px; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.main-nav a { color: var(--muted); font-weight: 700; font-size: 14px; }
.main-nav a.active { color: var(--blue); }
.icon-btn, .primary-btn, .ghost-btn { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; min-height: 40px; }
.icon-btn { width: 40px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.primary-btn { color: white; background: var(--orange); padding: 0 16px; font-weight: 800; box-shadow: 0 10px 24px rgba(249, 115, 22, .24); }
.ghost-btn { color: var(--ink); background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.34); padding: 0 16px; font-weight: 800; }
.large { min-height: 48px; padding: 0 22px; }
.mobile-menu { display: none; }

.view { display: none; min-height: calc(100vh - 76px); }
.view.active { display: block; }
.hero { min-height: 660px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 0 5vw 64px; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,18,38,.88), rgba(10,18,38,.42), rgba(10,18,38,.08)); }
.hero-content { position: relative; max-width: 760px; color: white; }
.eyebrow { margin: 0 0 10px; color: var(--orange); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { font-size: clamp(44px, 8vw, 96px); line-height: .92; letter-spacing: 0; margin-bottom: 22px; }
.hero-copy { max-width: 620px; color: rgba(255,255,255,.82); font-size: 20px; line-height: 1.55; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.metric-strip article { background: var(--panel); padding: 28px 5vw; }
.metric-strip strong { display: block; font-size: 28px; color: var(--blue); }
.metric-strip span { color: var(--muted); font-weight: 700; }

.section-grid, .page-head, .service-board, .studio-layout, .country-row, .pricing-grid, .package-hero, .builder-layout, .business-search, .business-grid, .flow-layout, .user-dashboard { padding-inline: 5vw; }
.section-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 36px; padding-block: 70px; }
.section-grid h2, .page-head h1 { font-size: clamp(30px, 4vw, 54px); line-height: 1.02; }
.feature-grid, .service-board, .pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.feature-card, .service-card, .price-card, .studio-panel, .admin-content, .admin-sidebar, .stat-card, .table-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.feature-card, .service-card, .price-card { padding: 22px; }
.feature-card i, .service-card i { color: var(--orange); }
.feature-card p, .service-card p, .page-head p { color: var(--muted); line-height: 1.55; }

.page-head { padding-top: 54px; padding-bottom: 26px; max-width: 980px; }
.service-card { min-height: 210px; }
.service-card .tag { display: inline-flex; padding: 5px 8px; border-radius: 8px; background: rgba(30,58,138,.08); color: var(--blue); font-size: 12px; font-weight: 900; }
.country-row { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; }
.country-row select, input, select { min-height: 42px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 0 12px; }
.price-card.popular { border-color: var(--orange); }
.price { font-size: 42px; color: var(--blue); font-weight: 900; }
.price-card ul { padding-left: 18px; color: var(--muted); line-height: 1.8; }
.price-card { position: relative; overflow: hidden; }
.price-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: var(--blue); }
.price-card.popular { transform: translateY(-8px); }
.plan-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; padding-top: 8px; }
.plan-top strong { font-size: 20px; }
.plan-top span { background: #facc15; color: #111827; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 900; }
.plan-cyan::before { background: #22c1dc; }
.plan-silver::before { background: #6b7280; }
.plan-gold::before { background: #f4b400; }
.plan-platinum::before { background: var(--blue); }
.package-intel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 5vw 22px; }
.package-intel article, .ai-console { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.package-intel article { padding: 18px; display: grid; gap: 8px; }
.package-intel i { color: var(--orange); }
.package-intel span { color: var(--muted); line-height: 1.5; }

.ai-os-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 26px; padding: 70px 5vw; background: color-mix(in srgb, var(--blue) 6%, var(--bg)); border-top: 1px solid var(--line); }
.ai-os-section h2 { font-size: clamp(30px, 4vw, 54px); line-height: 1.04; }
.ai-os-section p { color: var(--muted); line-height: 1.65; }
.console-head { height: 48px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.console-head span { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.console-head span:nth-child(2) { background: #facc15; }
.console-head span:nth-child(3) { background: #22c55e; }
.console-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 18px; }
.console-grid article { border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 8px; background: color-mix(in srgb, var(--panel) 86%, var(--blue)); }
.console-grid i { color: var(--orange); }
.console-grid small { color: var(--muted); }

.builder-layout { display: grid; grid-template-columns: 380px 1fr; gap: 22px; padding-bottom: 70px; }
.builder-controls, .builder-preview { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 22px; }
.builder-controls { display: grid; gap: 12px; align-self: start; }
.builder-controls textarea { min-height: 130px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 12px; resize: vertical; }
.control-row { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 800; }
.control-row input[type="color"] { min-height: 42px; padding: 4px; }
.store-preview { min-height: 620px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: white; color: #10213f; }
.store-cover { min-height: 210px; padding: 26px; color: white; display: flex; align-items: end; }
.store-cover h2 { font-size: 42px; margin-bottom: 8px; }
.store-body { padding: 24px; }
.store-profile-row { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.store-logo { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; border: 4px solid white; box-shadow: 0 8px 24px rgba(15,23,42,.2); background: white; }
.store-link { display: inline-flex; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.18); font-weight: 900; }
.store-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.store-product { padding: 16px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.store-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.store-actions a { padding: 10px 14px; border-radius: 8px; font-weight: 900; color: white; }
#cardCanvas { width: 100%; max-width: 720px; border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #0f172a; }

.flow-layout, .user-dashboard { display: grid; grid-template-columns: 280px 1fr; gap: 22px; padding-bottom: 70px; }
.flow-steps, .flow-panel, .user-sidebar { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 18px; align-self: start; }
.flow-step { width: 100%; border: 0 !important; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; cursor: pointer; text-align: left; font-weight: 900; appearance: none; font-size: 14px; }
.flow-step strong { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); }
.flow-step.active { background: rgba(30,58,138,.1); color: var(--blue); }
.flow-screen { display: none; }
.flow-screen.active { display: block; }
.signup-packages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.mini-package { border: 2px solid var(--line); border-radius: 8px; padding: 14px; cursor: pointer; background: var(--panel); min-height: 118px; display: grid; align-content: center; gap: 6px; }
.mini-package.selected { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(249,115,22,.12); }
.mini-package img { width: 100%; border-radius: 8px; display: block; margin-bottom: 8px; }
.flow-actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 18px; }
.ghost-dark { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; min-height: 42px; padding: 0 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 900; }
.payment-box { border: 1px solid var(--line); border-radius: 8px; padding: 22px; background: color-mix(in srgb, #ffc439 10%, var(--panel)); }
.paypal-btn { border: 0; border-radius: 10px; background: #ffc439; color: #003087; min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; gap: 8px; font-weight: 900; cursor: pointer; }
.user-dashboard { padding-top: 28px; }
.user-sidebar { position: sticky; top: 100px; }

.business-search { display: grid; grid-template-columns: 1fr 220px 220px; gap: 12px; padding-bottom: 22px; }
.business-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 70px; }
.business-card-item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.business-card-item .cover { min-height: 120px; background: linear-gradient(135deg, var(--blue), var(--orange)); color: white; display: flex; align-items: end; padding: 18px; }
.business-card-item .body { padding: 18px; }
.business-card-item .meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.business-card-item .link { color: var(--blue); font-weight: 900; word-break: break-all; }

.studio-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; padding-bottom: 60px; }
.studio-panel { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ai-output { margin-top: 18px; padding: 18px; background: color-mix(in srgb, var(--blue) 8%, var(--panel)); border-radius: 8px; min-height: 160px; line-height: 1.6; }
.module-list { display: grid; gap: 10px; }
.module-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.module-item i { color: var(--green); }

.admin-shell { display: grid; grid-template-columns: 270px 1fr; gap: 20px; padding: 24px; }
.admin-sidebar { position: sticky; top: 100px; align-self: start; padding: 16px; }
.admin-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.admin-tab { width: 100%; border: 0; background: transparent; color: var(--muted); display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 800; text-align: left; }
.admin-tab.active, .admin-tab:hover { background: rgba(30,58,138,.1); color: var(--blue); }
.admin-content { padding: 22px; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px; box-shadow: none; }
.stat-card strong { display: block; font-size: 28px; color: var(--blue); }
.filters { display: grid; grid-template-columns: 1fr 180px 180px 130px; gap: 10px; margin-bottom: 12px; }
.table-card { overflow: hidden; box-shadow: none; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); cursor: pointer; user-select: none; background: color-mix(in srgb, var(--bg) 70%, var(--panel)); }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 900; }
.hot { color: #9f1239; background: #ffe4e6; }
.warm { color: #92400e; background: #fef3c7; }
.won { color: #065f46; background: #d1fae5; }
.cold { color: #475569; background: #e2e8f0; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart { height: 230px; display: flex; align-items: flex-end; gap: 12px; padding: 18px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--orange), var(--blue)); border-radius: 8px 8px 0 0; min-height: 20px; position: relative; }
.bar span { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; }

.ai-fab { position: fixed; right: 22px; bottom: 22px; width: 62px; height: 62px; border: 0; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--blue), var(--orange)); box-shadow: var(--shadow); cursor: pointer; z-index: 45; }
.ai-chat { display: none; position: fixed; right: 22px; bottom: 96px; width: min(390px, calc(100vw - 28px)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 46; overflow: hidden; }
.ai-chat.open { display: block; }
.ai-chat header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-log { height: 320px; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-log p { padding: 10px 12px; border-radius: 8px; max-width: 85%; margin: 0; line-height: 1.45; }
.bot { background: color-mix(in srgb, var(--blue) 10%, var(--panel)); align-self: flex-start; }
.user { background: var(--blue); color: white; align-self: flex-end; }
.chat-input { display: grid; grid-template-columns: 1fr 46px; border-top: 1px solid var(--line); }
.chat-input input { border: 0; border-radius: 0; }
.chat-input button { border: 0; background: var(--orange); color: white; cursor: pointer; }

dialog { border: 0; padding: 0; border-radius: 8px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); width: min(520px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(15, 23, 42, .55); }
.lead-form { display: grid; gap: 12px; padding: 26px; position: relative; }
.dialog-close { position: absolute; right: 12px; top: 12px; }

@media (max-width: 1000px) {
  .main-nav { display: none; }
  .mobile-menu { display: inline-flex; }
  .section-grid, .studio-layout, .admin-shell, .ai-os-section { grid-template-columns: 1fr; }
  .feature-grid, .service-board, .pricing-grid, .stats-grid, .package-intel { grid-template-columns: repeat(2, 1fr); }
  .builder-layout, .business-search, .flow-layout, .user-dashboard { grid-template-columns: 1fr; }
  .business-grid { grid-template-columns: repeat(2, 1fr); }
  .signup-packages { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { position: static; }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .topbar { padding-inline: 16px; }
  .top-actions .primary-btn { display: none; }
  .hero { min-height: 610px; padding: 0 18px 36px; }
  .hero h1 { font-size: 48px; }
  .metric-strip, .feature-grid, .service-board, .pricing-grid, .stats-grid, .filters, .chart-row, .form-grid, .package-intel, .console-grid { grid-template-columns: 1fr; }
  .business-grid, .store-products { grid-template-columns: 1fr; }
  .signup-packages { grid-template-columns: 1fr; }
  .control-row { grid-template-columns: auto 1fr; }
  .admin-shell { padding: 12px; }
  .admin-head { align-items: flex-start; flex-direction: column; }
  th, td { white-space: nowrap; }
  .table-card { overflow-x: auto; }
}
