/* ============================================================
   OfisOS — Cloud White design system
   Ported faithfully from the approved Lovable design (design-ref/):
   oklch palette, Space Grotesk display + Inter body, gradient
   primary, soft surface cards, grid-line hero. Server-rendered,
   zero-build, self-hosted fonts.
   ============================================================ */

/* ---- fonts (variable, latin subset, self-hosted) ---- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-var-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/space-grotesk-var-latin.woff2") format("woff2");
}

/* ---- design tokens (light = Cloud White) ---- */
:root {
  color-scheme: light;
  --radius: 0.625rem;
  --background: oklch(0.992 0.002 250);
  --foreground: oklch(0.18 0.03 258);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.18 0.03 258);
  --primary: oklch(0.62 0.19 258);
  --primary-foreground: oklch(0.99 0.005 250);
  --primary-glow: oklch(0.75 0.16 245);
  --secondary: oklch(0.945 0.01 250);
  --secondary-foreground: oklch(0.22 0.03 258);
  --muted: oklch(0.955 0.008 250);
  --muted-foreground: oklch(0.55 0.03 255);
  --accent: oklch(0.94 0.03 245);
  --accent-foreground: oklch(0.30 0.09 258);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.915 0.012 250);
  --input: oklch(0.929 0.013 255);
  --ring: oklch(0.62 0.19 258);
  --surface: oklch(0.945 0.012 250);
  --success: oklch(0.62 0.15 155);

  --gradient-hero:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in oklab, var(--primary) 22%, transparent), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, color-mix(in oklab, var(--primary-glow) 18%, transparent), transparent 55%),
    linear-gradient(180deg, var(--background), var(--background));
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-glow));
  /* Button gradient: darker endpoints so near-white 14px text holds WCAG AA
     (>=4.5:1) across the whole run; the brighter --gradient-primary stays for
     non-text decoration (icon tiles, chart bars). */
  --gradient-btn: linear-gradient(135deg, oklch(0.47 0.19 258), oklch(0.53 0.17 250));
  /* Small colored text on light surfaces (eyebrows, badges) needs darker inks
     than --primary to pass AA at 10-12px. */
  --primary-strong: oklch(0.45 0.19 258);
  --success-strong: oklch(0.43 0.12 155);
  --shadow-soft: 0 1px 2px oklch(0.2 0.03 258 / 0.06), 0 8px 24px -12px oklch(0.2 0.03 258 / 0.10);
  --shadow-elevated: 0 10px 40px -12px oklch(0.35 0.12 258 / 0.28);
  --shadow-ring: 0 0 0 1px oklch(0.62 0.19 258 / 0.15);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;

  /* Logo mark: three ink rooms + one lit. Ink flips in dark mode; the lit
     square keeps the brand blue (lightened so it stays vivid on dark). */
  --logo-ink: #0b1e3a;
  --logo-lit: #0f59fe;
}

/* ---- dark tokens ---- */
[data-theme="dark"] {
  color-scheme: dark;
  --logo-ink: #e8edf6;
  --logo-lit: #5b8cff;
  --gradient-btn: linear-gradient(135deg, oklch(0.68 0.17 255), oklch(0.78 0.13 240));
  --primary-strong: oklch(0.72 0.15 255);
  --success-strong: oklch(0.72 0.14 155);
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.984 0.003 247.858);
  --card: oklch(0.185 0.04 264);
  --card-foreground: oklch(0.984 0.003 247.858);
  --primary: oklch(0.68 0.17 255);
  --primary-foreground: oklch(0.13 0.04 264);
  --primary-glow: oklch(0.78 0.13 240);
  --secondary: oklch(0.24 0.04 262);
  --secondary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --accent: oklch(0.279 0.041 260.031);
  --accent-foreground: oklch(0.984 0.003 247.858);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 12%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.68 0.17 255);
  --surface: oklch(0.22 0.04 262);
  --success: oklch(0.72 0.14 155);
  --shadow-soft: 0 1px 2px oklch(0 0 0 / 0.35), 0 8px 24px -12px oklch(0 0 0 / 0.5);
  --shadow-elevated: 0 10px 40px -12px oklch(0 0 0 / 0.6);
  --shadow-ring: 0 0 0 1px oklch(0.68 0.17 255 / 0.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --logo-ink: #e8edf6;
    --logo-lit: #5b8cff;
    --gradient-btn: linear-gradient(135deg, oklch(0.68 0.17 255), oklch(0.78 0.13 240));
    --primary-strong: oklch(0.72 0.15 255);
    --success-strong: oklch(0.72 0.14 155);
    --background: oklch(0.129 0.042 264.695);
    --foreground: oklch(0.984 0.003 247.858);
    --card: oklch(0.185 0.04 264);
    --card-foreground: oklch(0.984 0.003 247.858);
    --primary: oklch(0.68 0.17 255);
    --primary-foreground: oklch(0.13 0.04 264);
    --primary-glow: oklch(0.78 0.13 240);
    --secondary: oklch(0.24 0.04 262);
    --secondary-foreground: oklch(0.984 0.003 247.858);
    --muted: oklch(0.279 0.041 260.031);
    --muted-foreground: oklch(0.704 0.04 256.788);
    --accent: oklch(0.279 0.041 260.031);
    --accent-foreground: oklch(0.984 0.003 247.858);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 12%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.68 0.17 255);
    --surface: oklch(0.22 0.04 262);
    --success: oklch(0.72 0.14 155);
    --shadow-soft: 0 1px 2px oklch(0 0 0 / 0.35), 0 8px 24px -12px oklch(0 0 0 / 0.5);
    --shadow-elevated: 0 10px 40px -12px oklch(0 0 0 / 0.6);
    --shadow-ring: 0 0 0 1px oklch(0.68 0.17 255 / 0.3);
  }
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, button { font-family: inherit; }
svg.icon { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---- shared utilities (ported @utility blocks) ---- */
.surface-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth), border-color 0.4s var(--ease-smooth);
}
.surface-card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
}
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-bg { background: var(--gradient-hero); }
.grid-lines {
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--foreground) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--foreground) 6%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
}
.muted { color: var(--muted-foreground); }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary-strong);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-smooth);
  white-space: nowrap;
}
.btn .icon { width: 1rem; height: 1rem; }
.btn-primary {
  background-image: var(--gradient-btn);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-elevated);
}
.btn-primary:hover { filter: saturate(1.1) brightness(0.96); }
.btn-outline { border-color: var(--border); background: var(--card); color: var(--foreground); }
.btn-outline:hover { background: var(--secondary); }
.btn-dark { background: var(--foreground); color: var(--background); }
.btn-dark:hover { opacity: 0.9; }
.btn-ghost { color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--foreground); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 0.9375rem; }
.btn:focus-visible, a:focus-visible, button:focus-visible,
.mod-card:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ---- site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: color-mix(in oklab, var(--background) 70%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.site-header .wrap { display: flex; height: 4rem; align-items: center; justify-content: space-between; }
.brand-lockup { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.875rem; height: 1.875rem; flex: none;
}
.brand-svg { width: 100%; height: 100%; display: block; }
.logo-ink { fill: var(--logo-ink); }
.logo-lit { fill: var(--logo-lit); }
.brand-lockup:hover .logo-lit { fill: color-mix(in oklab, var(--logo-lit) 82%, white); }
.logo-lit, .logo-ink { transition: fill 0.25s var(--ease-smooth); }
.site-nav { display: none; align-items: center; gap: 2rem; font-size: 0.875rem; color: var(--muted-foreground); }
.site-nav a:hover { color: var(--foreground); }
@media (min-width: 768px) { .site-nav { display: flex; } }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 9999px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground);
}
.theme-toggle:hover { color: var(--foreground); background: var(--secondary); }
.theme-toggle .icon { width: 1rem; height: 1rem; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---- landing: hero ---- */
.hero { position: relative; overflow: hidden; }
.hero-grid-overlay { position: absolute; inset: 0; pointer-events: none; opacity: 0.7; }
.hero-inner { position: relative; padding: 6rem 0 7rem; }
@media (min-width: 768px) { .hero-inner { padding: 8rem 0 9rem; } }
.hero-copy { max-width: 48rem; margin: 0 auto; text-align: center; }
.pill-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid var(--border); border-radius: 9999px;
  background: color-mix(in oklab, var(--card) 70%, transparent);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground);
  box-shadow: var(--shadow-soft);
}
.pill-badge .icon { width: 0.875rem; height: 0.875rem; color: var(--primary); }
.hero-title { margin-top: 1.5rem; font-size: 3rem; font-weight: 600; line-height: 1.05; }
@media (min-width: 768px) { .hero-title { font-size: 4.5rem; } }
.hero-sub { max-width: 36rem; margin: 1.5rem auto 0; font-size: 1.125rem; line-height: 1.7; color: var(--muted-foreground); }
.hero-ctas { margin-top: 2.25rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.hero-note { margin-top: 1rem; font-size: 0.75rem; color: var(--muted-foreground); }

/* staggered load-in */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.7s var(--ease-smooth) both; }
.rise-1 { animation-delay: 0.05s; } .rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; } .rise-4 { animation-delay: 0.35s; }
.rise-5 { animation-delay: 0.5s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- landing: hero preview (browser mock) ---- */
.hero-preview { position: relative; max-width: 60rem; margin: 4rem auto 0; }
.hero-preview-glow { position: absolute; left: -2.5rem; right: -2.5rem; bottom: -2rem; z-index: -1; height: 6rem; border-radius: 9999px; background: color-mix(in oklab, var(--primary) 20%, transparent); filter: blur(48px); pointer-events: none; }
.browser-chrome { display: flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent); background: color-mix(in oklab, var(--secondary) 60%, transparent); padding: 0.625rem 1rem; }
.chrome-dot { width: 0.625rem; height: 0.625rem; border-radius: 9999px; background: color-mix(in oklab, var(--muted-foreground) 40%, transparent); }
.chrome-dot:nth-child(2) { background: color-mix(in oklab, var(--muted-foreground) 30%, transparent); }
.chrome-dot:nth-child(3) { background: color-mix(in oklab, var(--muted-foreground) 20%, transparent); }
.chrome-url { margin-left: 0.75rem; font-size: 0.75rem; color: var(--muted-foreground); }
.preview-body { display: grid; grid-template-columns: repeat(12, 1fr); }
.preview-side { display: none; grid-column: span 3; border-right: 1px solid color-mix(in oklab, var(--border) 70%, transparent); padding: 1rem; }
@media (min-width: 768px) { .preview-side { display: block; } }
.preview-side-label { margin-bottom: 0.75rem; font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.preview-rooms { list-style: none; margin: 0; padding: 0; font-size: 0.875rem; }
.preview-rooms li { display: flex; align-items: center; gap: 0.5rem; border-radius: 0.375rem; padding: 0.375rem 0.5rem; color: var(--muted-foreground); }
.preview-rooms li.active { background: var(--secondary); color: var(--foreground); }
.preview-rooms .dot { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: var(--primary); }
.preview-main { grid-column: span 12; padding: 1.5rem; }
@media (min-width: 768px) { .preview-main { grid-column: span 9; } }
.preview-topline { display: flex; align-items: center; justify-content: space-between; }
.preview-kicker { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.preview-figure { margin-top: 0.25rem; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.delta-chip { border-radius: 9999px; background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary-strong); padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 500; }
.preview-stats { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.preview-stat { border: 1px solid color-mix(in oklab, var(--border) 70%, transparent); border-radius: 0.5rem; background: var(--background); padding: 0.75rem; }
.preview-stat p:first-child { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.preview-stat p:last-child { margin-top: 0.25rem; font-size: 0.875rem; font-weight: 500; }
.preview-chart {
  margin-top: 1rem; height: 6rem; border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 0.5rem; padding: 0.75rem;
  background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 10%, transparent), transparent);
}
.preview-bars { display: flex; height: 100%; align-items: flex-end; gap: 0.375rem; }
.preview-bars span { flex: 1; border-radius: 2px; background-image: var(--gradient-primary); opacity: 0.8; }

/* ---- landing: sections ---- */
.logo-strip { border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent); border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent); background: color-mix(in oklab, var(--secondary) 40%, transparent); }
.logo-strip-inner { padding: 2rem 0; }
.logo-strip p { text-align: center; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground); }
.logo-names { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 2.5rem; opacity: 0.7; }
.logo-names span { font-family: var(--font-display); font-size: 0.875rem; font-weight: 600; letter-spacing: -0.02em; color: color-mix(in oklab, var(--foreground) 70%, transparent); }

.section { padding: 6rem 0; }
@media (min-width: 768px) { .section { padding: 8rem 0; } }
.section-alt { border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent); background: color-mix(in oklab, var(--secondary) 40%, transparent); }
.section-head { max-width: 42rem; margin: 0 auto; text-align: center; }
.section-title { margin-top: 0.75rem; font-size: 2.25rem; font-weight: 600; line-height: 1.15; }
@media (min-width: 768px) { .section-title { font-size: 3rem; } }
.section-sub { margin-top: 1.25rem; color: var(--muted-foreground); }

.split { display: grid; gap: 4rem; }
@media (min-width: 768px) { .split { grid-template-columns: 1fr 1fr; align-items: center; } }
.split h2 { margin-top: 0.75rem; font-size: 2.25rem; font-weight: 600; line-height: 1.15; }
@media (min-width: 768px) { .split h2 { font-size: 3rem; } }
.split-sub { margin-top: 1.25rem; font-size: 1.125rem; color: var(--muted-foreground); }
.check-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.check-list li { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.875rem; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.check-list .check-dot {
  margin-top: 2px; display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; border-radius: 9999px; flex: none;
  background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary);
}
.check-list .check-dot .icon { width: 0.75rem; height: 0.75rem; }

.mini-grid-card { position: relative; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.mini-cell {
  position: relative; overflow: hidden;
  aspect-ratio: 1; border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 1rem;
  background:
    radial-gradient(120% 90% at 15% 0%, color-mix(in oklab, var(--primary) 6%, transparent), transparent 70%),
    var(--background);
  padding: 0.75rem 0.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.625rem;
  transition: transform 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth),
              box-shadow 0.35s var(--ease-smooth);
}
/* diagonal sheen, revealed on hover */
.mini-cell::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--primary) 10%, transparent) 50%, transparent 58%);
  transition: opacity 0.35s var(--ease-smooth);
}
.mini-cell:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--primary) 42%, transparent);
  box-shadow: var(--shadow-soft);
}
.mini-cell:hover::after { opacity: 1; }

.mini-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 0.8125rem; flex: none;
  background: color-mix(in oklab, var(--primary) 11%, transparent);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 14%, transparent);
  transition: transform 0.35s var(--ease-smooth), background 0.35s var(--ease-smooth),
              color 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}
.mini-cell .mini-icon .icon { width: 1.3125rem; height: 1.3125rem; }
.mini-cell:hover .mini-icon {
  background-image: var(--gradient-btn);
  color: var(--primary-foreground);
  box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--primary) 55%, transparent);
  transform: translateY(-1px) scale(1.05);
}
.mini-cell p {
  font-size: 0.6875rem; font-weight: 500; line-height: 1.25; text-align: center;
  color: color-mix(in oklab, var(--foreground) 82%, transparent);
}
.mini-grid-note { margin-top: 1rem; font-size: 0.75rem; color: var(--muted-foreground); }
.corner-glow { position: absolute; right: -1.5rem; top: -1.5rem; width: 6rem; height: 6rem; border-radius: 9999px; background: color-mix(in oklab, var(--primary) 30%, transparent); filter: blur(48px); pointer-events: none; }

.feature-grid { margin-top: 3.5rem; display: grid; gap: 1rem; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }
.feature-card { padding: 1.5rem; }
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
  background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary);
  transition: all 0.3s var(--ease-smooth);
}
.feature-card:hover .feature-icon { background-image: var(--gradient-primary); color: var(--primary-foreground); }
.feature-card h3 { margin-top: 1.25rem; font-size: 1.125rem; font-weight: 600; }
.feature-card p { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }

.rooms-grid { margin-top: 3.5rem; display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .rooms-grid { grid-template-columns: repeat(3, 1fr); } }
.room-card { position: relative; overflow: hidden; padding: 2rem; }
.room-card .room-no { position: absolute; right: 1.5rem; top: 1.5rem; font-family: var(--font-display); font-size: 3.75rem; font-weight: 600; color: color-mix(in oklab, var(--foreground) 5%, transparent); }
.room-card h3 { font-size: 1.25rem; font-weight: 600; }
.room-card p { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }

.pricing-grid { margin-top: 3.5rem; display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.plan { padding: 2rem; }
.plan.featured { border-color: color-mix(in oklab, var(--primary) 40%, transparent); box-shadow: var(--shadow-elevated); }
.plan-head { display: flex; align-items: center; justify-content: space-between; }
.plan-head h3 { font-size: 1.25rem; font-weight: 600; }
.plan-pop { border-radius: 9999px; background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary); padding: 0.125rem 0.625rem; font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.plan-tag { margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted-foreground); }
.plan-price { margin-top: 1.5rem; display: flex; align-items: baseline; gap: 0.25rem; }
.plan-price strong { font-family: var(--font-display); font-size: 2.25rem; font-weight: 600; }
.plan-price span { font-size: 0.875rem; color: var(--muted-foreground); }
.plan-features { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.875rem; }
.plan-features li { display: flex; align-items: flex-start; gap: 0.5rem; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.plan-features .icon { width: 1rem; height: 1rem; margin-top: 2px; color: var(--primary); }
.plan .btn { margin-top: 2rem; width: 100%; }

.cta-panel { position: relative; overflow: hidden; padding: 2.5rem; text-align: center; }
@media (min-width: 768px) { .cta-panel { padding: 4rem; } }
.cta-bg { position: absolute; inset: 0; pointer-events: none; opacity: 0.6; }
.cta-content { position: relative; }
.cta-content > .icon { width: 2rem; height: 2rem; margin: 0 auto; color: var(--primary); }
.cta-content h2 { margin-top: 1rem; font-size: 2.25rem; font-weight: 600; line-height: 1.15; }
@media (min-width: 768px) { .cta-content h2 { font-size: 3rem; } }
.cta-content .section-sub { max-width: 36rem; margin-left: auto; margin-right: auto; }
.cta-form { max-width: 28rem; margin: 2rem auto 0; display: flex; flex-direction: column; gap: 0.5rem; }
@media (min-width: 640px) { .cta-form { flex-direction: row; } }
.cta-form input {
  flex: 1; border: 1px solid var(--border); border-radius: 9999px;
  background: var(--card); color: var(--foreground);
  padding: 0.75rem 1rem; font-size: 0.875rem; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.cta-form input:focus { border-color: var(--primary); box-shadow: var(--shadow-ring); }

.site-footer { border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent); }
.site-footer .wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 2.5rem; padding-bottom: 2.5rem;
  font-size: 0.875rem; color: var(--muted-foreground);
}
@media (min-width: 768px) { .site-footer .wrap { flex-direction: row; } }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; }
.footer-brand .brand-mark { width: 1.375rem; height: 1.375rem; }
.footer-brand strong { font-family: var(--font-display); color: var(--foreground); }
.footer-links { display: flex; align-items: center; gap: 1.5rem; }
.footer-links a:hover { color: var(--foreground); }

/* ============================================================
   ONBOARDING — the module marketplace
   ============================================================ */
.onboarding-page { padding: 3rem 0 8rem; }
.onboarding-head { max-width: 44rem; }
.onboarding-head h1 { margin-top: 0.75rem; font-size: 2.25rem; font-weight: 600; line-height: 1.1; }
@media (min-width: 768px) { .onboarding-head h1 { font-size: 3rem; } }
.onboarding-head .section-sub { margin-top: 1rem; }

.setup-strip { margin-top: 2.5rem; display: grid; gap: 1rem; }
@media (min-width: 768px) { .setup-strip { grid-template-columns: 2fr 1fr; } }
.field label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.field input, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px);
  background: var(--card); color: var(--foreground);
  padding: 0.75rem 1rem; font-size: 0.9375rem; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: var(--shadow-ring); }

/* bundles */
.bundle-row { margin-top: 1.25rem; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .bundle-row { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .bundle-row { grid-template-columns: repeat(6, 1fr); } }
.bundle-card {
  position: relative; text-align: left; border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); background: var(--card);
  padding: 1rem; transition: all 0.3s var(--ease-smooth);
}
.bundle-card:hover { border-color: color-mix(in oklab, var(--primary) 40%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.bundle-card.active { border-color: var(--primary); box-shadow: var(--shadow-ring), var(--shadow-soft); background: color-mix(in oklab, var(--primary) 4%, var(--card)); }
.bundle-card .icon { width: 1.125rem; height: 1.125rem; color: var(--primary); }
.bundle-card h3 { margin-top: 0.625rem; font-size: 0.8125rem; font-weight: 600; line-height: 1.25; }
.bundle-card p { margin-top: 0.375rem; font-size: 0.6875rem; line-height: 1.4; color: var(--muted-foreground); }
.bundle-card .bundle-count { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 0.625rem; font-weight: 600; color: var(--muted-foreground); border: 1px solid var(--border); border-radius: 9999px; padding: 0.0625rem 0.4375rem; background: var(--background); }
.bundle-card.active .bundle-count { color: var(--primary); border-color: color-mix(in oklab, var(--primary) 40%, var(--border)); }

/* marketplace layout: aisles + sticky summary */
.market-layout { margin-top: 3rem; display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 1024px) { .market-layout { grid-template-columns: minmax(0, 1fr) 20rem; } }

.market-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.75rem; position: sticky; top: 4rem; z-index: 20; background: color-mix(in oklab, var(--background) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 0.75rem 0; }
.market-search { position: relative; flex: 1; min-width: 9rem; max-width: 16rem; }
.market-search .icon { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--muted-foreground); }
.market-search input {
  width: 100%; border: 1px solid var(--border); border-radius: 9999px;
  background: var(--card); color: var(--foreground);
  padding: 0.625rem 1rem 0.625rem 2.5rem; font-size: 0.875rem; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.market-search input:focus { border-color: var(--primary); box-shadow: var(--shadow-ring); }
.chip-row { display: flex; flex-wrap: nowrap; gap: 0.375rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .filter-chip { flex: none; }
.filter-chip {
  border: 1px solid var(--border); border-radius: 9999px; background: var(--card);
  padding: 0.375rem 0.875rem; font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground);
  transition: all 0.2s var(--ease-smooth);
}
.filter-chip:hover { color: var(--foreground); border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); }
.filter-chip.active { background: var(--foreground); border-color: var(--foreground); color: var(--background); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.no-results {
  display: none; margin-top: 2rem; text-align: center;
  border: 1px dashed var(--border); border-radius: calc(var(--radius) + 6px);
  padding: 2.5rem 1.5rem; color: var(--muted-foreground); font-size: 0.875rem;
}
.no-results.show { display: block; }
.no-results .btn { margin-top: 1rem; }

.aisle { margin-top: 2.5rem; }
.aisle:first-child { margin-top: 0; }
.aisle-head { display: flex; align-items: baseline; gap: 0.75rem; }
.aisle-head h2 { font-size: 1.25rem; font-weight: 600; }
.aisle-head .aisle-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: var(--aisle-accent, var(--primary)); flex: none; align-self: center; }
.aisle-head p { font-size: 0.8125rem; color: var(--muted-foreground); }
.aisle-grid { margin-top: 1rem; display: grid; gap: 0.875rem; }
@media (min-width: 640px) { .aisle-grid { grid-template-columns: repeat(2, 1fr); } }

/* module cards */
.mod-card {
  position: relative; display: flex; flex-direction: column; gap: 0.625rem;
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px);
  background: var(--card); padding: 1.125rem;
  transition: all 0.3s var(--ease-smooth);
  cursor: pointer;
}
.mod-card:hover { border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.mod-card.selected {
  border-color: var(--primary);
  box-shadow: var(--shadow-ring), var(--shadow-soft);
  background: color-mix(in oklab, var(--primary) 4%, var(--card));
}
.mod-card.hidden-by-filter { display: none; }
.mod-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.mod-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; flex: none;
  background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary);
  transition: all 0.3s var(--ease-smooth);
}
.mod-card.selected .mod-icon { background-image: var(--gradient-primary); color: var(--primary-foreground); }
.mod-name-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.mod-card h3 { font-size: 0.9375rem; font-weight: 600; }
.mod-card .mod-tagline { font-size: 0.8125rem; line-height: 1.5; color: var(--muted-foreground); }
.mod-badge {
  border-radius: 9999px; padding: 0.125rem 0.5rem;
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.mod-badge.b-popular { background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary-strong); }
.mod-badge.b-ai { background: color-mix(in oklab, oklch(0.62 0.25 305) 14%, transparent); color: oklch(0.44 0.25 305); }
[data-theme="dark"] .mod-badge.b-ai { color: oklch(0.78 0.18 305); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mod-badge.b-ai { color: oklch(0.78 0.18 305); } }
.mod-badge.b-premium { background: color-mix(in oklab, oklch(0.75 0.15 85) 18%, transparent); color: oklch(0.42 0.11 75); }
[data-theme="dark"] .mod-badge.b-premium { color: oklch(0.82 0.14 85); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mod-badge.b-premium { color: oklch(0.82 0.14 85); } }
.mod-badge.b-new { background: color-mix(in oklab, var(--success) 14%, transparent); color: var(--success-strong); }
.mod-deps { display: flex; align-items: center; gap: 0.375rem; font-size: 0.6875rem; color: var(--muted-foreground); }
.mod-deps .icon { width: 0.75rem; height: 0.75rem; }
.mod-deps strong { color: var(--foreground); font-weight: 500; }

/* iOS-style toggle */
.toggle {
  position: relative; width: 2.5rem; height: 1.5rem; flex: none;
  border-radius: 9999px;
  /* visible off-state boundary (a plain --border track was ~1.17:1) */
  border: 1px solid color-mix(in oklab, var(--muted-foreground) 55%, var(--border));
  background: var(--secondary);
  transition: background 0.25s var(--ease-smooth), border-color 0.25s;
  padding: 0;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 1.125rem; height: 1.125rem; border-radius: 9999px;
  background: var(--card); box-shadow: 0 1px 3px oklch(0 0 0 / 0.2);
  transition: transform 0.25s var(--ease-smooth);
}
.mod-card.selected .toggle, .toggle.on {
  background-image: var(--gradient-primary);
  border-color: transparent;
}
.mod-card.selected .toggle::after, .toggle.on::after { transform: translateX(1rem); }

/* sticky office summary */
.office-summary { position: sticky; top: 5.5rem; }
.office-summary-card { padding: 1.5rem; }
.office-summary h2 { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.office-summary h2 .icon { color: var(--primary); }
.summary-count { margin-top: 0.375rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.summary-rooms { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.375rem; max-height: 17rem; overflow-y: auto; }
.summary-chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  border: 1px solid color-mix(in oklab, var(--primary) 25%, var(--border));
  background: color-mix(in oklab, var(--primary) 6%, var(--card));
  border-radius: 9999px; padding: 0.25rem 0.625rem;
  font-size: 0.6875rem; font-weight: 500;
  animation: rise 0.3s var(--ease-smooth) both;
}
.summary-chip .icon { width: 0.75rem; height: 0.75rem; color: var(--primary); }
.summary-chip button { display: inline-flex; border: 0; background: none; color: var(--muted-foreground); padding: 0; }
.summary-chip button:hover { color: var(--destructive); }
.summary-chip button .icon { width: 0.75rem; height: 0.75rem; color: inherit; }
.summary-chip.auto-dep { border-style: dashed; opacity: 0.85; }
.summary-empty { margin-top: 1rem; font-size: 0.8125rem; color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: calc(var(--radius) + 2px); padding: 1.25rem; text-align: center; }
.summary-cta { margin-top: 1.25rem; width: 100%; }
.summary-note { margin-top: 0.75rem; font-size: 0.6875rem; text-align: center; color: var(--muted-foreground); }

/* mobile bottom bar */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 0.875rem 1.25rem calc(0.875rem + env(safe-area-inset-bottom));
}
.mobile-bar .count { font-size: 0.8125rem; font-weight: 500; }
.mobile-bar .count strong { font-family: var(--font-display); font-size: 1.125rem; }
@media (min-width: 1024px) { .mobile-bar { display: none; } }

/* ============================================================
   DASHBOARD — the office
   ============================================================ */
.app-shell-header { border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent); }
.dashboard-page { padding: 2.5rem 0 6rem; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.dash-head h1 { margin-top: 0.5rem; font-size: 2rem; font-weight: 600; line-height: 1.1; }
@media (min-width: 768px) { .dash-head h1 { font-size: 2.75rem; } }
.dash-head .muted { margin-top: 0.5rem; }
.dash-actions { display: flex; gap: 0.75rem; }

.welcome-banner {
  margin-top: 2rem; display: flex; align-items: center; gap: 1rem;
  border: 1px solid color-mix(in oklab, var(--primary) 30%, var(--border));
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 8%, var(--card)), var(--card));
  border-radius: calc(var(--radius) + 6px); padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-soft);
}
.welcome-banner .icon { width: 1.5rem; height: 1.5rem; color: var(--primary); }
.welcome-banner strong { font-family: var(--font-display); }
.welcome-banner p { font-size: 0.875rem; color: var(--muted-foreground); }

.dash-stats { margin-top: 2rem; display: grid; gap: 0.875rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .dash-stats { grid-template-columns: repeat(4, 1fr); } }
.dash-stat { padding: 1.125rem 1.25rem; }
.dash-stat .label { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.dash-stat .value { margin-top: 0.375rem; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.dash-stat .hint { margin-top: 0.125rem; font-size: 0.6875rem; color: var(--muted-foreground); }

.dash-section { margin-top: 3rem; }
.dash-section-head { display: flex; align-items: center; gap: 0.75rem; }
.dash-section-head .aisle-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: var(--aisle-accent, var(--primary)); }
.dash-section-head h2 { font-size: 1.125rem; font-weight: 600; }
.dash-section-head span { font-size: 0.75rem; color: var(--muted-foreground); }
.dash-grid { margin-top: 1rem; display: grid; gap: 0.875rem; }
@media (min-width: 640px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: repeat(3, 1fr); } }

.room-tile {
  display: flex; align-items: flex-start; gap: 0.875rem; padding: 1.125rem;
}
.room-tile .mod-icon { width: 2.75rem; height: 2.75rem; }
.room-tile h3 { font-size: 0.9375rem; font-weight: 600; }
.room-tile p { margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.5; color: var(--muted-foreground); }
.room-tile:hover .mod-icon { background-image: var(--gradient-primary); color: var(--primary-foreground); }
.room-tile .go { margin-left: auto; align-self: center; color: var(--muted-foreground); transition: transform 0.25s var(--ease-smooth), color 0.25s; }
.room-tile:hover .go { transform: translateX(3px); color: var(--primary); }

.add-room-tile {
  display: flex; align-items: center; justify-content: center; gap: 0.625rem;
  border: 1.5px dashed var(--border); border-radius: calc(var(--radius) + 6px);
  padding: 1.5rem; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground);
  transition: all 0.3s var(--ease-smooth); background: transparent;
}
.add-room-tile:hover { border-color: color-mix(in oklab, var(--primary) 45%, transparent); color: var(--primary); background: color-mix(in oklab, var(--primary) 4%, transparent); }

.empty-office { margin-top: 3rem; text-align: center; padding: 4rem 2rem; }
.empty-office .icon { width: 2.5rem; height: 2.5rem; margin: 0 auto; color: var(--muted-foreground); }
.empty-office h2 { margin-top: 1rem; font-size: 1.5rem; }
.empty-office p { margin-top: 0.5rem; color: var(--muted-foreground); }

/* ---- module room (stub page) ---- */
.room-page { padding: 3rem 0 6rem; }
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.breadcrumb a:hover { color: var(--foreground); }
.breadcrumb .icon { width: 0.875rem; height: 0.875rem; }
.room-hero { margin-top: 2rem; display: flex; align-items: center; gap: 1.25rem; }
.room-hero .mod-icon { width: 4rem; height: 4rem; border-radius: 1.125rem; background-image: var(--gradient-primary); color: var(--primary-foreground); }
.room-hero .mod-icon .icon { width: 1.75rem; height: 1.75rem; }
.room-hero h1 { font-size: 2rem; font-weight: 600; }
.room-hero .muted { margin-top: 0.25rem; }
.room-body { margin-top: 2.5rem; display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .room-body { grid-template-columns: 2fr 1fr; align-items: start; } }
.room-desc-card { padding: 2rem; }
.room-desc-card h2 { font-size: 1.125rem; }
.room-desc-card p { margin-top: 0.75rem; font-size: 0.9375rem; line-height: 1.7; color: var(--muted-foreground); }
.furnishing {
  margin-top: 1.5rem; display: flex; align-items: center; gap: 0.75rem;
  border: 1px dashed color-mix(in oklab, var(--primary) 35%, var(--border));
  background: color-mix(in oklab, var(--primary) 5%, transparent);
  border-radius: calc(var(--radius) + 2px); padding: 1rem 1.25rem;
  font-size: 0.8125rem; color: var(--muted-foreground);
}
.furnishing .icon { color: var(--primary); }
.room-side { display: grid; gap: 1rem; }
.room-side-card { padding: 1.5rem; }
.room-side-card h3 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.room-side-card .list { margin-top: 0.75rem; display: grid; gap: 0.5rem; font-size: 0.8125rem; }
.room-side-card .list a { display: flex; align-items: center; gap: 0.5rem; color: var(--foreground); }
.room-side-card .list a:hover { color: var(--primary); }
.room-side-card .list .icon { width: 0.875rem; height: 0.875rem; color: var(--primary); }
.danger-link { color: var(--destructive); font-size: 0.8125rem; background: none; border: none; padding: 0; display: inline-flex; align-items: center; gap: 0.375rem; }
.danger-link:hover { text-decoration: underline; }
.danger-link .icon { width: 0.875rem; height: 0.875rem; }

/* toast */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(150%);
  z-index: 50; display: flex; align-items: center; gap: 0.625rem;
  background: var(--foreground); color: var(--background);
  border-radius: 9999px; padding: 0.625rem 1.25rem; font-size: 0.8125rem; font-weight: 500;
  box-shadow: var(--shadow-elevated);
  transition: transform 0.4s var(--ease-smooth);
  max-width: min(92vw, 30rem);
  pointer-events: none; /* never block taps on what's underneath */
}
/* keep the toast clear of the fixed mobile action bar */
@media (max-width: 1023.98px) {
  .toast { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast .icon { width: 1rem; height: 1rem; color: var(--primary-glow); }

/* legal + contact pages */
.legal-page { padding: 4rem 0 6rem; }
.legal-page .wrap { max-width: 46rem; }
.legal-page h1 { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 0.5rem; }
.legal-page h2 { font-size: 1.125rem; font-weight: 600; margin-top: 2.5rem; margin-bottom: 0.625rem; }
.legal-page p, .legal-page li { font-size: 0.9375rem; line-height: 1.7; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.legal-page p + p { margin-top: 0.75rem; }
.legal-page ul { margin: 0.75rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.625rem; }
.legal-page a { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 2px; }
.legal-meta { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.operator-card { margin: 1.5rem 0; padding: 1.5rem; display: grid; gap: 0.375rem; }
.operator-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-foreground); margin-bottom: 0.25rem; }
.operator-entity { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; }
.operator-pending { color: var(--muted-foreground); font-style: italic; }

/* ============================================================
   ACCOUNTING MODULE — two-column shell + data-dense pages
   ============================================================ */
.acct-shell { padding: 2rem 0 5rem; }
.acct-wrap { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .acct-wrap { grid-template-columns: 15rem minmax(0, 1fr); } }
.acct-side { position: sticky; top: 5rem; }
.acct-side-title { display: flex; align-items: center; gap: 0.625rem; padding: 0.375rem 0.75rem 0.875rem; font-family: var(--font-display); }
.acct-side-title .mod-icon { width: 2rem; height: 2rem; border-radius: 0.5rem; background-image: var(--gradient-btn); color: var(--primary-foreground); }
.acct-side-title .mod-icon .icon { width: 1rem; height: 1rem; }
.acct-nav { display: flex; flex-direction: column; gap: 1px; }
.acct-nav a { padding: 0.4375rem 0.75rem; border-radius: 0.5rem; font-size: 0.8438rem; color: var(--muted-foreground); border-left: 2px solid transparent; }
.acct-nav a:hover { color: var(--foreground); background: var(--secondary); }
.acct-nav a.active { color: var(--foreground); background: var(--secondary); border-left-color: var(--primary); font-weight: 500; }
@media (max-width: 899px) { .acct-side { position: static; } .acct-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .acct-nav a { white-space: nowrap; border-left: 0; } }

.acct-main { min-width: 0; }
.acct-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.acct-head h1 { font-size: 1.5rem; font-weight: 600; }
.acct-head .muted { margin-top: 0.25rem; font-size: 0.8125rem; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.acct-flash { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1.25rem; padding: 0.75rem 1rem; border-radius: calc(var(--radius) + 2px); font-size: 0.8438rem; border: 1px solid color-mix(in oklab, var(--success) 40%, var(--border)); background: color-mix(in oklab, var(--success) 8%, var(--card)); }
.acct-flash.err { border-color: color-mix(in oklab, var(--destructive) 45%, var(--border)); background: color-mix(in oklab, var(--destructive) 8%, var(--card)); }
.acct-flash .icon { color: var(--success); flex: none; }
.acct-flash.err .icon { color: var(--destructive); }

.stat-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.5rem; }
@media (min-width: 780px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { padding: 0.875rem 1rem; }
.stat-tile .label { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); }
.stat-tile .value { margin-top: 0.25rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.stat-tile .value.neg { color: var(--destructive); }
.stat-tile .value.pos { color: var(--success-strong); }
.stat-tile .hint { margin-top: 0.125rem; font-size: 0.6875rem; color: var(--muted-foreground); }

.data-card { padding: 0; overflow: hidden; }
.data-card + .data-card, .surface-card + .data-card, .data-card + .surface-card { margin-top: 1.25rem; }
.data-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
table.data th { text-align: left; font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 0.5625rem 0.875rem; border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, transparent); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: color-mix(in oklab, var(--secondary) 45%, transparent); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .neg { color: var(--destructive); }
table.data tfoot td { border-top: 2px solid var(--border); font-weight: 600; background: color-mix(in oklab, var(--secondary) 35%, transparent); }
table.data .sub { color: var(--muted-foreground); font-size: 0.75rem; }
table.data a { color: var(--primary-strong); }
table.data a:hover { text-decoration: underline; }
.row-struck td { text-decoration: line-through; opacity: 0.55; }
.row-dim td { opacity: 0.65; }

.tag { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.0938rem 0.5625rem; font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.tag.open, .tag.issued { background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary-strong); }
.tag.closed, .tag.booked { background: color-mix(in oklab, var(--muted-foreground) 15%, transparent); color: var(--muted-foreground); }
.tag.filed { background: color-mix(in oklab, oklch(0.62 0.25 305) 14%, transparent); color: oklch(0.44 0.25 305); }
.tag.paid, .tag.ok { background: color-mix(in oklab, var(--success) 14%, transparent); color: var(--success-strong); }
.tag.draft { background: color-mix(in oklab, oklch(0.75 0.15 85) 18%, transparent); color: oklch(0.42 0.11 75); }
.tag.overdue, .tag.cancelled { background: color-mix(in oklab, var(--destructive) 12%, transparent); color: var(--destructive); }
.tag.role { background: color-mix(in oklab, var(--primary) 8%, transparent); color: var(--primary-strong); text-transform: none; letter-spacing: 0; }

.acct-form { padding: 1.25rem; display: grid; gap: 0.875rem; }
.form-grid { display: grid; gap: 0.875rem; }
@media (min-width: 700px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.acct-form .field input, .acct-form .field select, .acct-form .field textarea, table.data input, table.data select {
  width: 100%; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
  background: var(--card); color: var(--foreground); padding: 0.4375rem 0.625rem;
  font-size: 0.8125rem; outline: none;
}
.acct-form .field input:focus, .acct-form .field select:focus, table.data input:focus, table.data select:focus { border-color: var(--primary); box-shadow: var(--shadow-ring); }
.acct-form .field label { font-size: 0.6563rem; }
table.data input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
.line-balance { display: flex; justify-content: flex-end; gap: 1.5rem; padding: 0.75rem 0.875rem; font-size: 0.8125rem; font-variant-numeric: tabular-nums; border-top: 1px solid var(--border); }
.line-balance strong.ok { color: var(--success-strong); }
.line-balance strong.off { color: var(--destructive); }

.empty-note { padding: 2.25rem 1.5rem; text-align: center; color: var(--muted-foreground); font-size: 0.8438rem; }
.acct-note { margin-top: 1rem; font-size: 0.6875rem; color: var(--muted-foreground); }
.btn-xs { padding: 0.25rem 0.75rem; font-size: 0.7188rem; border-radius: 9999px; }

/* invoice print view */
@media print {
  .site-header, .acct-side, .acct-actions, .acct-flash, .toast, .no-print { display: none !important; }
  .acct-shell { padding: 0; }
  .acct-wrap { display: block; }
  .surface-card { border: 0; box-shadow: none; }
  body { background: white; }
}

/* ============================================================
   /tax — Swiss & EU compliance page
   ============================================================ */
.tax-hero { padding: 4.5rem 0 3rem; }
.tax-hero .section-head { margin: 0; text-align: left; max-width: 46rem; }
.tax-hero h1 { margin-top: 0.75rem; font-size: 2.5rem; font-weight: 600; line-height: 1.1; }
@media (min-width: 768px) { .tax-hero h1 { font-size: 3.25rem; } }
.verified-stamp {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem;
  border: 1px solid color-mix(in oklab, var(--success) 35%, var(--border));
  background: color-mix(in oklab, var(--success) 7%, var(--card));
  border-radius: 9999px; padding: 0.375rem 0.875rem;
  font-size: 0.75rem; font-weight: 500; color: var(--foreground);
}
.verified-stamp .icon { width: 0.875rem; height: 0.875rem; color: var(--success-strong); }

.tax-stats { display: grid; gap: 0.875rem; grid-template-columns: repeat(2, 1fr); margin-top: 2.5rem; }
@media (min-width: 780px) { .tax-stats { grid-template-columns: repeat(4, 1fr); } }

.status-pill {
  display: inline-flex; align-items: center; gap: 0.375rem;
  border-radius: 9999px; padding: 0.125rem 0.5625rem;
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
}
.status-pill.live { background: color-mix(in oklab, var(--success) 14%, transparent); color: var(--success-strong); }
.status-pill.review { background: color-mix(in oklab, oklch(0.75 0.15 85) 20%, transparent); color: oklch(0.42 0.11 75); }
[data-theme="dark"] .status-pill.review { color: oklch(0.82 0.14 85); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .status-pill.review { color: oklch(0.82 0.14 85); } }
.status-pill.planned { background: color-mix(in oklab, var(--muted-foreground) 15%, transparent); color: var(--muted-foreground); }

.tax-section { padding: 3.5rem 0; border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent); }
.tax-section > .wrap > .eyebrow { margin-bottom: 0.5rem; }
.tax-section h2 { font-size: 1.875rem; font-weight: 600; line-height: 1.15; max-width: 40rem; }
.tax-section .lede { margin-top: 1rem; max-width: 44rem; font-size: 1rem; line-height: 1.7; color: var(--muted-foreground); }

.rate-strip { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.rate-chip {
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px);
  background: var(--card); padding: 0.75rem 1rem; min-width: 8.5rem;
}
.rate-chip .pct { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; }
.rate-chip .lbl { margin-top: 0.125rem; font-size: 0.6875rem; color: var(--muted-foreground); }
.rate-chip .box { margin-top: 0.25rem; font-size: 0.625rem; font-variant-numeric: tabular-nums; color: var(--primary-strong); }

.fact-grid { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 860px) { .fact-grid { grid-template-columns: repeat(2, 1fr); } }
.fact-card { padding: 1.5rem; }
.fact-card h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.fact-card h3 .icon { width: 1rem; height: 1rem; color: var(--primary); flex: none; }
.fact-card p { margin-top: 0.625rem; font-size: 0.875rem; line-height: 1.65; color: var(--muted-foreground); }
.fact-card ul { margin: 0.75rem 0 0; padding-left: 1.125rem; font-size: 0.875rem; line-height: 1.7; color: var(--muted-foreground); }
.fact-card li + li { margin-top: 0.25rem; }
.fact-card strong { color: var(--foreground); font-weight: 500; }
.fact-card cite { display: block; margin-top: 0.875rem; font-size: 0.6875rem; font-style: normal; color: var(--muted-foreground); }
.fact-card cite a { color: var(--primary-strong); }
.fact-card cite a:hover { text-decoration: underline; }

.country-card { padding: 0; overflow: hidden; }
.country-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.country-head .flag { font-size: 1.25rem; line-height: 1; }
.country-head h3 { font-size: 1rem; font-weight: 600; }
.country-head .meta { margin-left: auto; font-size: 0.6875rem; color: var(--muted-foreground); text-align: right; }
.country-body { padding: 1rem 1.25rem 1.25rem; }
.country-body .form-name { font-size: 0.75rem; color: var(--muted-foreground); }
details.code-table { margin-top: 1rem; }
details.code-table > summary {
  cursor: pointer; font-size: 0.75rem; font-weight: 500; color: var(--primary-strong);
  list-style: none; display: inline-flex; align-items: center; gap: 0.375rem;
}
details.code-table > summary::-webkit-details-marker { display: none; }
details.code-table > summary::before { content: "▸"; font-size: 0.625rem; transition: transform 0.2s var(--ease-smooth); }
details.code-table[open] > summary::before { transform: rotate(90deg); }
details.code-table > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
details.code-table .data-scroll { margin-top: 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); }

.timeline { margin-top: 2rem; border-left: 2px solid var(--border); padding-left: 1.5rem; display: grid; gap: 1.5rem; }
.timeline li { list-style: none; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.5rem - 6px); top: 0.4rem;
  width: 10px; height: 10px; border-radius: 9999px;
  background: var(--card); border: 2px solid var(--primary);
}
.timeline li.done::before { background: var(--primary); }
.timeline .when { font-family: var(--font-display); font-size: 0.8125rem; font-weight: 600; color: var(--primary-strong); }
.timeline h4 { margin-top: 0.125rem; font-size: 0.9375rem; font-weight: 600; }
.timeline p { margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.6; color: var(--muted-foreground); }

.disclaimer {
  margin-top: 2.5rem; padding: 1.25rem 1.5rem;
  border: 1px dashed var(--border); border-radius: calc(var(--radius) + 4px);
  background: color-mix(in oklab, var(--secondary) 40%, transparent);
  font-size: 0.8125rem; line-height: 1.7; color: var(--muted-foreground);
}
.disclaimer strong { color: var(--foreground); font-weight: 500; }
