/* =====================================================================
   Spacyn Design System, foundations: tokens.css  (v0.1, 2026-10-15)
   Single source of truth. Prefix --sp-. Light is the default; dark is
   applied by prefers-color-scheme (unless data-theme="light") or by
   <html data-theme="dark">.
   Rule: components read SEMANTIC tokens (--sp-color-*, --sp-status-*,
   --sp-radius-control ...). Primitives (--sp-yellow-500 ...) are only
   referenced from this file.
   Breakpoints (media queries cannot read custom properties, write the
   literals): sm 640 | md 768 | lg 1024 | xl 1280 | 2xl 1440.
   "Mobile" is max-width 767.98px, "desktop" min-width 768px; never mix 767 and 768.
   ===================================================================== */

:root {
  color-scheme: light dark;

  /* ---------- 1. Colour primitives (identical in both themes) ---------- */
  /* yellow */
  --sp-yellow-50: #FFFBEB;
  --sp-yellow-100: #FFF5CC;
  --sp-yellow-200: #FFEA99;
  --sp-yellow-300: #FFDB57;
  --sp-yellow-400: #FFCD28;
  --sp-yellow-500: #FEC006;
  --sp-yellow-600: #EEB205;
  --sp-yellow-700: #C79500;
  --sp-yellow-800: #7A5600;
  --sp-yellow-900: #4A3300;
  /* neutral */
  --sp-neutral-0: #FFFFFF;
  --sp-neutral-50: #FAF9F6;
  --sp-neutral-100: #F4F2EC;
  --sp-neutral-200: #E8E5DC;
  --sp-neutral-300: #D4D0C4;
  --sp-neutral-400: #857F70;
  --sp-neutral-500: #6B6557;
  --sp-neutral-600: #5A564A;
  --sp-neutral-700: #47443A;
  --sp-neutral-800: #2E2C25;
  --sp-neutral-900: #1D1B15;
  --sp-neutral-950: #14130E;
  /* red */
  --sp-red-50: #FEF2F0;
  --sp-red-100: #FDE4E1;
  --sp-red-200: #F9C5BE;
  --sp-red-300: #F2998E;
  --sp-red-400: #E8685A;
  --sp-red-500: #D94838;
  --sp-red-600: #C23424;
  --sp-red-700: #A5281B;
  --sp-red-800: #8A1C12;
  --sp-red-900: #5E120C;
  /* green */
  --sp-green-50: #F0FAEC;
  --sp-green-100: #E3F6DC;
  --sp-green-200: #C5E8B8;
  --sp-green-300: #98D381;
  --sp-green-400: #66B84B;
  --sp-green-500: #3F9A2B;
  --sp-green-600: #2F7D1F;
  --sp-green-700: #266319;
  --sp-green-800: #1B4F12;
  --sp-green-900: #123509;
  /* blue */
  --sp-blue-50: #EEF4FE;
  --sp-blue-100: #E7EEFC;
  --sp-blue-200: #C9DAF8;
  --sp-blue-300: #9CBAF0;
  --sp-blue-400: #6A92E3;
  --sp-blue-500: #3F6DD0;
  --sp-blue-600: #2C54B3;
  --sp-blue-700: #1F4399;
  --sp-blue-800: #1E3F8F;
  --sp-blue-900: #14285C;
  /* orange */
  --sp-orange-50: #FFF4EA;
  --sp-orange-100: #FFE6CF;
  --sp-orange-200: #FFCB9C;
  --sp-orange-300: #FFA865;
  --sp-orange-400: #F5833A;
  --sp-orange-500: #E0641A;
  --sp-orange-600: #C24E0E;
  --sp-orange-700: #9F3E0B;
  --sp-orange-800: #7C3009;
  --sp-orange-900: #4F1E05;

  /* ---------- 2. Semantic colour (light) ---------- */
  --sp-color-bg: var(--sp-neutral-50);
  --sp-color-surface: var(--sp-neutral-0);
  --sp-color-surface-raised: var(--sp-neutral-0);
  --sp-color-surface-sunken: var(--sp-neutral-100);
  --sp-color-surface-inverse: var(--sp-neutral-900);
  --sp-color-surface-hover: rgb(41 28 5 / 0.05);
  --sp-color-surface-pressed: rgb(41 28 5 / 0.10);
  --sp-color-surface-selected: var(--sp-yellow-100);
  --sp-color-overlay: rgb(20 19 14 / 0.5);
  --sp-color-scrim-media: rgb(20 19 14 / 0.64);
  --sp-color-skeleton-base: var(--sp-neutral-100);
  --sp-color-skeleton-shine: var(--sp-neutral-50);
  --sp-color-text: var(--sp-neutral-900);
  --sp-color-text-secondary: var(--sp-neutral-600);
  --sp-color-text-tertiary: var(--sp-neutral-500);
  --sp-color-text-disabled: var(--sp-neutral-400);
  --sp-color-text-on-brand: var(--sp-neutral-900);
  --sp-color-text-on-dark: #FFFFFF;
  --sp-color-text-inverse: var(--sp-neutral-0);
  --sp-color-text-brand: var(--sp-yellow-800);
  --sp-color-border: var(--sp-neutral-200);
  --sp-color-border-strong: var(--sp-neutral-300);
  --sp-color-border-control: var(--sp-neutral-400);
  --sp-color-border-selected: var(--sp-neutral-900);
  --sp-color-border-focus: var(--sp-neutral-900);
  --sp-color-brand: var(--sp-yellow-500);
  --sp-color-brand-hover: var(--sp-yellow-600);
  --sp-color-brand-pressed: var(--sp-yellow-700);
  --sp-color-brand-disabled: var(--sp-neutral-200);
  --sp-color-on-brand: var(--sp-neutral-900);
  --sp-color-on-brand-disabled: var(--sp-neutral-500);
  --sp-color-brand-soft: var(--sp-yellow-100);
  --sp-color-brand-soft-border: var(--sp-yellow-300);
  --sp-color-action-secondary: var(--sp-neutral-900);
  --sp-color-action-secondary-hover: var(--sp-neutral-800);
  --sp-color-action-secondary-pressed: var(--sp-neutral-950);
  --sp-color-on-action-secondary: var(--sp-neutral-0);
  --sp-color-link: var(--sp-blue-700);
  --sp-color-link-hover: var(--sp-blue-900);
  --sp-status-success-bg: var(--sp-green-100);
  --sp-status-success-fg: var(--sp-green-800);
  --sp-status-success-border: var(--sp-green-200);
  --sp-status-success-solid: var(--sp-green-600);
  --sp-status-success-on-solid: var(--sp-neutral-0);
  --sp-status-warning-bg: var(--sp-orange-100);
  --sp-status-warning-fg: var(--sp-orange-800);
  --sp-status-warning-border: var(--sp-orange-200);
  --sp-status-warning-solid: var(--sp-orange-600);
  --sp-status-warning-on-solid: var(--sp-neutral-0);
  --sp-status-danger-bg: var(--sp-red-100);
  --sp-status-danger-fg: var(--sp-red-800);
  --sp-status-danger-border: var(--sp-red-200);
  --sp-status-danger-solid: var(--sp-red-600);
  --sp-status-danger-on-solid: var(--sp-neutral-0);
  --sp-status-info-bg: var(--sp-blue-100);
  --sp-status-info-fg: var(--sp-blue-800);
  --sp-status-info-border: var(--sp-blue-200);
  --sp-status-info-solid: var(--sp-blue-600);
  --sp-status-info-on-solid: var(--sp-neutral-0);
  --sp-status-neutral-bg: var(--sp-neutral-100);
  --sp-status-neutral-fg: var(--sp-neutral-700);
  --sp-status-neutral-border: var(--sp-neutral-300);
  --sp-status-neutral-solid: var(--sp-neutral-700);
  --sp-status-neutral-on-solid: var(--sp-neutral-0);
  --sp-focus-ring-color: var(--sp-neutral-900);
  --sp-shadow-color: 41 28 5;
  --sp-shadow-1: 0 1px 2px rgb(var(--sp-shadow-color) / 0.06), 0 1px 3px rgb(var(--sp-shadow-color) / 0.08);
  --sp-shadow-2: 0 2px 4px rgb(var(--sp-shadow-color) / 0.05), 0 6px 16px rgb(var(--sp-shadow-color) / 0.09);
  --sp-shadow-3: 0 4px 8px rgb(var(--sp-shadow-color) / 0.06), 0 12px 28px rgb(var(--sp-shadow-color) / 0.13);
  --sp-shadow-4: 0 8px 16px rgb(var(--sp-shadow-color) / 0.08), 0 24px 48px rgb(var(--sp-shadow-color) / 0.18);
  --sp-shadow-sheet: 0 -8px 32px rgb(var(--sp-shadow-color) / 0.14);

  /* booking / payment / payout / KYC status map (one set for guest, host, admin) */
  --sp-status-pending-bg: var(--sp-status-warning-bg);
  --sp-status-pending-fg: var(--sp-status-warning-fg);
  --sp-status-pending-border: var(--sp-status-warning-border);
  --sp-status-processing-bg: var(--sp-status-info-bg);
  --sp-status-processing-fg: var(--sp-status-info-fg);
  --sp-status-processing-border: var(--sp-status-info-border);
  --sp-status-paid-bg: var(--sp-status-success-bg);
  --sp-status-paid-fg: var(--sp-status-success-fg);
  --sp-status-paid-border: var(--sp-status-success-border);
  --sp-status-completed-bg: var(--sp-status-neutral-bg);
  --sp-status-completed-fg: var(--sp-status-neutral-fg);
  --sp-status-completed-border: var(--sp-status-neutral-border);
  --sp-status-expired-bg: var(--sp-status-neutral-bg);
  --sp-status-expired-fg: var(--sp-status-neutral-fg);
  --sp-status-expired-border: var(--sp-status-neutral-border);
  --sp-status-cancelled-bg: var(--sp-status-danger-bg);
  --sp-status-cancelled-fg: var(--sp-status-danger-fg);
  --sp-status-cancelled-border: var(--sp-status-danger-border);
  --sp-status-refunded-bg: var(--sp-status-info-bg);
  --sp-status-refunded-fg: var(--sp-status-info-fg);
  --sp-status-refunded-border: var(--sp-status-info-border);
  /* confirmed = a paid booking the host accepted: solid green, the strongest positive state */
  --sp-status-confirmed-bg: var(--sp-status-success-solid);
  --sp-status-confirmed-fg: var(--sp-status-success-on-solid);
  --sp-status-confirmed-border: var(--sp-status-success-solid);
  /* failed = a payment or payout that did not go through: solid red, the strongest negative state */
  --sp-status-failed-bg: var(--sp-status-danger-solid);
  --sp-status-failed-fg: var(--sp-status-danger-on-solid);
  --sp-status-failed-border: var(--sp-status-danger-solid);
  /* review = a human must look (manual refund, KYC check, payout review): solid orange */
  --sp-status-review-bg: var(--sp-status-warning-solid);
  --sp-status-review-fg: var(--sp-status-warning-on-solid);
  --sp-status-review-border: var(--sp-status-warning-solid);

  /* ---------- 3. Typography ---------- */
  --sp-font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sp-font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace; /* booking codes, IDs only */
  --sp-numeric-features: tabular-nums lining-nums; /* font-variant-numeric for every price, time, duration, count */
  --sp-weight-regular: 400;
  --sp-weight-semibold: 600;
  --sp-weight-bold: 700;
  --sp-weight-extrabold: 800;

  /* role: size / line-height / weight / tracking (mobile first, min 12px) */
  --sp-text-display-size: 2rem;        --sp-text-display-lh: 2.375rem;  --sp-text-display-weight: 800; --sp-text-display-tracking: -0.025em;
  --sp-text-title-1-size: 1.5rem;      --sp-text-title-1-lh: 1.875rem;      --sp-text-title-1-weight: 800;  --sp-text-title-1-tracking: -0.02em;
  --sp-text-title-2-size: 1.25rem;     --sp-text-title-2-lh: 1.625rem;   --sp-text-title-2-weight: 700;  --sp-text-title-2-tracking: -0.01em;
  --sp-text-title-3-size: 1rem;        --sp-text-title-3-lh: 1.375rem;    --sp-text-title-3-weight: 700;  --sp-text-title-3-tracking: -0.005em;
  --sp-text-lead-size: 1.125rem;       --sp-text-lead-lh: 1.75rem;      --sp-text-lead-weight: 400;     --sp-text-lead-tracking: 0;
  --sp-text-body-size: 1rem;           --sp-text-body-lh: 1.375rem;       --sp-text-body-weight: 400;     --sp-text-body-tracking: 0;
  --sp-text-body-strong-size: 1rem;    --sp-text-body-strong-lh: 1.5rem; --sp-text-body-strong-weight: 600; --sp-text-body-strong-tracking: 0;
  --sp-text-body-sm-size: 0.875rem;    --sp-text-body-sm-lh: 1.25rem;   --sp-text-body-sm-weight: 400;  --sp-text-body-sm-tracking: 0;
  --sp-text-label-size: 0.875rem;      --sp-text-label-lh: 1.25rem;     --sp-text-label-weight: 600;    --sp-text-label-tracking: 0;
  --sp-text-button-size: 1rem;         --sp-text-button-lh: 1.25rem;    --sp-text-button-weight: 600;   --sp-text-button-tracking: 0;
  --sp-text-caption-size: 0.75rem;     --sp-text-caption-lh: 1rem;      --sp-text-caption-weight: 400;  --sp-text-caption-tracking: 0.01em;
  --sp-text-caption-strong-size: 0.75rem; --sp-text-caption-strong-lh: 1rem; --sp-text-caption-strong-weight: 600; --sp-text-caption-strong-tracking: 0.01em;
  --sp-text-overline-size: 0.75rem;    --sp-text-overline-lh: 1rem;     --sp-text-overline-weight: 700; --sp-text-overline-tracking: 0.06em; /* uppercase */
  --sp-text-numeric-size: 1rem;        --sp-text-numeric-lh: 1.5rem;    --sp-text-numeric-weight: 700;  --sp-text-numeric-tracking: 0;
  --sp-text-price-size: 1.125rem;      --sp-text-price-lh: 1.5rem;      --sp-text-price-weight: 800;    --sp-text-price-tracking: -0.01em;
  --sp-text-price-lg-size: 1.75rem;    --sp-text-price-lg-lh: 2rem;     --sp-text-price-lg-weight: 800; --sp-text-price-lg-tracking: -0.02em;
  --sp-text-timer-size: 2rem;          --sp-text-timer-lh: 2.25rem;     --sp-text-timer-weight: 700;    --sp-text-timer-tracking: 0;
  /* shorthand for the font property: font: var(--sp-font-body); then add letter-spacing from the role */
  --sp-font-display: 800 var(--sp-text-display-size)/var(--sp-text-display-lh) var(--sp-font-sans);
  --sp-font-title-1: 800 var(--sp-text-title-1-size)/var(--sp-text-title-1-lh) var(--sp-font-sans);
  --sp-font-title-2: 700 var(--sp-text-title-2-size)/var(--sp-text-title-2-lh) var(--sp-font-sans);
  --sp-font-title-3: 700 var(--sp-text-title-3-size)/var(--sp-text-title-3-lh) var(--sp-font-sans);
  --sp-font-body: 400 var(--sp-text-body-size)/var(--sp-text-body-lh) var(--sp-font-sans);
  --sp-font-body-strong: 600 var(--sp-text-body-strong-size)/var(--sp-text-body-strong-lh) var(--sp-font-sans);
  --sp-font-body-sm: 400 var(--sp-text-body-sm-size)/var(--sp-text-body-sm-lh) var(--sp-font-sans);
  --sp-font-label: 600 var(--sp-text-label-size)/var(--sp-text-label-lh) var(--sp-font-sans);
  --sp-font-button: 600 var(--sp-text-button-size)/var(--sp-text-button-lh) var(--sp-font-sans);
  --sp-font-caption: 400 var(--sp-text-caption-size)/var(--sp-text-caption-lh) var(--sp-font-sans);
  --sp-font-numeric: 700 var(--sp-text-numeric-size)/var(--sp-text-numeric-lh) var(--sp-font-sans);
  --sp-font-price: 800 var(--sp-text-price-size)/var(--sp-text-price-lh) var(--sp-font-sans);
  --sp-font-price-lg: 800 var(--sp-text-price-lg-size)/var(--sp-text-price-lg-lh) var(--sp-font-sans);
  --sp-font-timer: 700 var(--sp-text-timer-size)/var(--sp-text-timer-lh) var(--sp-font-sans);

  /* ---------- 4. Spacing (4px base) ---------- */
  --sp-space-0: 0;
  --sp-space-0-5: 2px;
  --sp-space-1: 4px;
  --sp-space-2: 8px;
  --sp-space-3: 12px;
  --sp-space-4: 16px;
  --sp-space-5: 20px;
  --sp-space-6: 24px;
  --sp-space-8: 32px;
  --sp-space-10: 40px;
  --sp-space-12: 48px;
  --sp-space-16: 64px;
  --sp-space-20: 80px;
  /* semantic spacing */
  --sp-gap-inline: var(--sp-space-2);   /* icon + label, chips in a row */
  --sp-gap-stack: var(--sp-space-3);    /* lines inside a card */
  --sp-gap-card: var(--sp-space-4);     /* between cards in a list */
  --sp-gap-section: var(--sp-space-6);  /* between page sections (mobile, compact 2026-10-16) */
  --sp-pad-card: var(--sp-space-3);
  --sp-pad-sheet: var(--sp-space-5);

  /* ---------- 5. Layout ---------- */
  --sp-gutter: 16px;                     /* page side padding: 16 (phone) / 24 (md) / 32 (lg) */
  --sp-container-prose: 40rem;           /* 640: descriptions, legal, forms */
  --sp-container-app: 75rem;             /* 1200: guest app content */
  --sp-container-wide: 90rem;            /* 1440: host / admin workbench */
  --sp-sidebar-w: 15rem;                 /* 240: host, creator, admin sidebar */
  --sp-header-h: 3rem;                   /* 48: top bar on phone (56 from md) */
  --sp-header-h-desktop: 4.5rem;         /* 72 */
  --sp-bottom-nav-h: 3.5rem;             /* 56, plus the safe area (compact 2026-10-16) */
  --sp-safe-top: env(safe-area-inset-top, 0px);
  --sp-safe-bottom: env(safe-area-inset-bottom, 0px);
  --sp-sheet-handle-w: 2.5rem;
  --sp-sheet-snap-peek: 0.17;            /* map sheet snap points, same as today's vaul config */
  --sp-sheet-snap-half: 0.58;
  --sp-sheet-snap-full: 0.88;

  /* ---------- 6. Radius ---------- */
  --sp-radius-0: 0;
  --sp-radius-1: 4px;
  --sp-radius-2: 8px;
  --sp-radius-3: 12px;
  --sp-radius-4: 16px;
  --sp-radius-5: 20px;
  --sp-radius-6: 24px;
  --sp-radius-7: 32px;
  --sp-radius-full: 9999px;
  --sp-radius-control: var(--sp-radius-3);  /* buttons, inputs, selects (8px in compact density) */
  --sp-radius-tag: var(--sp-radius-2);
  --sp-radius-media: var(--sp-radius-3);    /* photos inside cards */
  --sp-radius-card: var(--sp-radius-4);
  --sp-radius-sheet: var(--sp-radius-6);    /* top corners of bottom sheets and dialogs */
  --sp-radius-pill: var(--sp-radius-full);  /* chips, status pills, map price pins, avatars */

  /* ---------- 7. Elevation (warm tinted; channels in --sp-shadow-color) ---------- */
  /* shadow-1 card at rest | 2 card hover, sticky bars | 3 popover, dropdown, toast | 4 modal, sheet */
  --sp-shadow-0: none;

  /* ---------- 8. Borders ---------- */
  --sp-border-width: 1px;
  --sp-border-width-strong: 2px;
  --sp-border: var(--sp-border-width) solid var(--sp-color-border);
  --sp-border-control: var(--sp-border-width) solid var(--sp-color-border-control);

  /* ---------- 9. Z-index ---------- */
  --sp-z-base: 0;
  --sp-z-raised: 1;
  --sp-z-map-chrome: 50;  /* search + filters floating over the map */
  --sp-z-sticky: 100;     /* headers, bottom nav, sticky CTA bars */
  --sp-z-dropdown: 200;   /* popovers, selects, date pickers */
  --sp-z-overlay: 300;    /* scrim */
  --sp-z-sheet: 400;      /* bottom sheets, dialogs */
  --sp-z-toast: 500;
  --sp-z-max: 9999;       /* skip links, dev tools only */

  /* ---------- 10. Controls (comfortable density; see [data-density="compact"]) ---------- */
  --sp-control-h: 44px;       /* primary button, input, select, search (48 from md) */
  --sp-control-h-sm: 44px;    /* secondary / small button: still a valid touch target */
  --sp-control-px: 20px;
  --sp-control-px-sm: 16px;
  --sp-control-gap: 8px;
  --sp-row-h: 52px;           /* list row with trailing control (56 from md) */
  --sp-hit-min: 44px;         /* minimum touch target on any touch layout */
  --sp-text-control-size: var(--sp-text-button-size);
  --sp-text-control-lh: var(--sp-text-button-lh);

  /* ---------- 11. Icons ---------- */
  --sp-icon-xs: 16px;   /* inline with caption text */
  --sp-icon-sm: 20px;   /* default in buttons, inputs, rows */
  --sp-icon-md: 24px;   /* navigation, headers */
  --sp-icon-lg: 32px;   /* empty states, feature tiles */
  --sp-icon-xl: 48px;   /* illustrations */
  --sp-icon-stroke: 2px;     /* Lucide default; decided after the component pass */
  --sp-icon-tile: 40px;      /* icon on a soft round background */

  /* ---------- 12. Motion ---------- */
  --sp-ease-standard: cubic-bezier(0.2, 0, 0, 1);       /* things that move within the screen */
  --sp-ease-enter: cubic-bezier(0.22, 1, 0.36, 1);      /* appearing: decelerates. Same curve as SPACYN_MOTION today */
  --sp-ease-exit: cubic-bezier(0.4, 0, 1, 1);           /* leaving: accelerates */
  --sp-ease-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1);/* sheets, big layout moves */
  --sp-ease-linear: linear;
  --sp-dur-instant: 100ms;  /* press feedback, colour change on tap */
  --sp-dur-fast: 150ms;     /* hover, small fades, exit */
  --sp-dur-base: 200ms;     /* default: chips, toggles, popover in */
  --sp-dur-moderate: 300ms; /* cards, accordions, toast in */
  --sp-dur-slow: 400ms;     /* sheets, scrims, route swaps */
  --sp-dur-slower: 500ms;   /* rare: hero, success moment */
  --sp-spring-snappy: linear(0, 0.042, 0.139, 0.262, 0.389, 0.51, 0.619, 0.711, 0.787, 0.848, 0.895, 0.93, 0.957, 0.975, 0.988, 0.996, 1.002, 1.004, 1.006, 1.006, 1.006, 1.005, 1.005, 1.004, 1);
  --sp-spring-snappy-dur: 450ms;
  --sp-spring-smooth: linear(0, 0.041, 0.132, 0.244, 0.359, 0.467, 0.563, 0.646, 0.716, 0.774, 0.821, 0.86, 0.89, 0.914, 0.934, 0.949, 0.96, 0.97, 0.977, 0.982, 1);
  --sp-spring-smooth-dur: 580ms;
  --sp-spring-bouncy: linear(0, 0.04, 0.141, 0.281, 0.438, 0.598, 0.746, 0.876, 0.982, 1.062, 1.117, 1.149, 1.162, 1.16, 1.146, 1.125, 1.1, 1.074, 1.049, 1.026, 1.008, 0.994, 0.983, 0.977, 0.974, 0.974, 0.975, 0.979, 0.982, 0.987, 0.991, 0.995, 1);
  --sp-spring-bouncy-dur: 750ms;
  --sp-motion-distance-sheet: 100%;   /* travel of a sheet; 0 under reduced motion */
  --sp-motion-distance-small: 8px;    /* travel of popovers, toasts, list items */
  --sp-loop-count: infinite;          /* shimmer, pulse; 1 under reduced motion */
  --sp-spin-dur: 800ms;               /* spinner: kept, but slower under reduced motion */
  /* named transitions: use these instead of transition-all */
  --sp-transition-colors: color var(--sp-dur-fast) var(--sp-ease-standard), background-color var(--sp-dur-fast) var(--sp-ease-standard), border-color var(--sp-dur-fast) var(--sp-ease-standard), fill var(--sp-dur-fast) var(--sp-ease-standard), stroke var(--sp-dur-fast) var(--sp-ease-standard);
  --sp-transition-opacity: opacity var(--sp-dur-base) var(--sp-ease-standard);
  --sp-transition-shadow: box-shadow var(--sp-dur-base) var(--sp-ease-standard);
  --sp-transition-press: transform var(--sp-dur-instant) var(--sp-ease-standard);
  --sp-transition-enter: opacity var(--sp-dur-moderate) var(--sp-ease-enter), transform var(--sp-dur-moderate) var(--sp-ease-enter);
  --sp-transition-exit: opacity var(--sp-dur-fast) var(--sp-ease-exit), transform var(--sp-dur-fast) var(--sp-ease-exit);
  --sp-transition-sheet: transform var(--sp-dur-slow) var(--sp-ease-emphasized);
  --sp-transition-scrim: opacity var(--sp-dur-slow) var(--sp-ease-standard);
  --sp-transition-spring: transform var(--sp-spring-snappy-dur) var(--sp-spring-snappy);
  --sp-transition-map-pin: background-color var(--sp-dur-base) var(--sp-ease-standard), color var(--sp-dur-base) var(--sp-ease-standard), transform var(--sp-dur-base) var(--sp-ease-standard), box-shadow var(--sp-dur-base) var(--sp-ease-standard);

  /* ---------- 13. Focus ---------- */
  --sp-focus-ring-width: 2px;
  --sp-focus-ring-offset: 2px;
  --sp-focus-ring: var(--sp-focus-ring-width) solid var(--sp-focus-ring-color);

  /* ---------- 14. Opacity ---------- */
  --sp-opacity-disabled: 0.45;
  --sp-opacity-muted: 0.7;
  --sp-opacity-pressed: 0.88;
  --sp-opacity-scrim: 0.5;

  /* ---------- 15. Map (target behaviour, see maps-motion.md) ---------- */
  --sp-map-pin-bg: var(--sp-color-surface);
  --sp-map-pin-fg: var(--sp-color-text);
  --sp-map-pin-selected-bg: var(--sp-color-action-secondary);   /* selected = ink, like Airbnb; yellow stays for the CTA */
  --sp-map-pin-selected-fg: var(--sp-color-on-action-secondary);
  --sp-map-pin-visited-fg: var(--sp-color-text-tertiary);
  --sp-map-pin-h: 36px;
  --sp-map-pin-scale-active: 1.08;
  --sp-map-fit-padding: 48px;         /* one padding for every fit action */
  --sp-map-settle-ms: 350ms;          /* wait before "Cari di area ini" counts a move */
  /* map placeholder / vector style: derived from roles, so they follow the theme */
  --sp-map-land: var(--sp-color-surface-sunken);
  --sp-map-road: var(--sp-color-surface);
  --sp-map-park: color-mix(in srgb, var(--sp-green-500) 18%, var(--sp-color-surface-sunken));
  --sp-map-water: color-mix(in srgb, var(--sp-blue-500) 22%, var(--sp-color-surface-sunken));
  --sp-map-popup-tail: 8px;

  /* ---------- 16. Component sizes (added after the component pass) ---------- */
  --sp-switch-w: 52px;
  --sp-switch-h: 32px;
  --sp-avatar-xs: 24px;
  --sp-avatar-sm: 32px;
  --sp-avatar-md: 40px;
  --sp-avatar-lg: 56px;
  --sp-avatar-xl: 80px;
  --sp-dialog-w: 480px;
  --sp-dialog-w-lg: 640px;
  --sp-toast-w: 360px;
  --sp-popover-w: 280px;
  --sp-tooltip-max-w: 240px;
  --sp-sidebar-w: 264px;
  --sp-sidebar-w-collapsed: 72px;
  --sp-upload-h: 160px;
  --sp-timeline-hour-h: 64px;         /* host day timeline: one hour */
  --sp-scroll-fade: 24px;             /* edge mask on horizontal strips (date strip, rails) */
  --sp-z-popup: 60;                   /* map popup card, above pins and map chrome */
  --sp-shimmer-dur: 1400ms;
  --sp-tracking-code: 0.06em;         /* booking codes, VA numbers (mono) */
  --sp-qr-bg: #ffffff;                /* QR codes stay black-on-white in every theme so scanners read them */
  --sp-qr-fg: #000000;
  --sp-color-inverse-hover: color-mix(in srgb, var(--sp-color-text-inverse) 10%, transparent);
  --sp-color-danger-solid-hover: var(--sp-red-700);
  --sp-color-current: var(--sp-color-text-brand);   /* aria-current marker (nav), distinct from selection */
}

/* ---------- Dark theme ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sp-color-bg: var(--sp-neutral-950);
    --sp-color-surface: var(--sp-neutral-900);
    --sp-color-surface-raised: #27251D;
    --sp-color-surface-sunken: #0E0D09;
    --sp-color-surface-inverse: var(--sp-neutral-100);
    --sp-color-surface-hover: rgb(255 244 214 / 0.06);
    --sp-color-surface-pressed: rgb(255 244 214 / 0.12);
    --sp-color-surface-selected: rgb(254 192 6 / 0.16);
    --sp-color-overlay: rgb(0 0 0 / 0.62);
    --sp-color-scrim-media: rgb(20 19 14 / 0.64);
    --sp-color-skeleton-base: #2A2820;
    --sp-color-skeleton-shine: #37342A;
    --sp-color-text: var(--sp-neutral-100);
    --sp-color-text-secondary: #CFCAB9;
    --sp-color-text-tertiary: #A8A396;
    --sp-color-text-disabled: #6B6557;
    --sp-color-text-on-brand: var(--sp-neutral-900);
    --sp-color-text-on-dark: #FFFFFF;
    --sp-color-text-inverse: var(--sp-neutral-900);
    --sp-color-text-brand: var(--sp-yellow-300);
    --sp-color-border: #38352B;
    --sp-color-border-strong: #4F4B3F;
    --sp-color-border-control: #857F70;
    --sp-color-border-selected: var(--sp-neutral-100);
    --sp-color-border-focus: var(--sp-yellow-300);
    --sp-color-brand: var(--sp-yellow-500);
    --sp-color-brand-hover: var(--sp-yellow-400);
    --sp-color-brand-pressed: var(--sp-yellow-600);
    --sp-color-brand-disabled: #38352B;
    --sp-color-on-brand: var(--sp-neutral-900);
    --sp-color-on-brand-disabled: #A8A396;
    --sp-color-brand-soft: rgb(254 192 6 / 0.14);
    --sp-color-brand-soft-border: rgb(254 192 6 / 0.4);
    --sp-color-action-secondary: var(--sp-neutral-100);
    --sp-color-action-secondary-hover: var(--sp-neutral-200);
    --sp-color-action-secondary-pressed: var(--sp-neutral-300);
    --sp-color-on-action-secondary: var(--sp-neutral-900);
    --sp-color-link: #8FB0F5;
    --sp-color-link-hover: #BBD0FA;
    --sp-status-success-bg: #17301A;
    --sp-status-success-fg: var(--sp-green-200);
    --sp-status-success-border: #2E5A31;
    --sp-status-success-solid: var(--sp-green-300);
    --sp-status-success-on-solid: var(--sp-neutral-950);
    --sp-status-warning-bg: #3E2210;
    --sp-status-warning-fg: var(--sp-orange-200);
    --sp-status-warning-border: #6F3F1D;
    --sp-status-warning-solid: var(--sp-orange-300);
    --sp-status-warning-on-solid: var(--sp-neutral-950);
    --sp-status-danger-bg: #3B1A16;
    --sp-status-danger-fg: var(--sp-red-200);
    --sp-status-danger-border: #6A2E27;
    --sp-status-danger-solid: var(--sp-red-300);
    --sp-status-danger-on-solid: var(--sp-neutral-950);
    --sp-status-info-bg: #18274A;
    --sp-status-info-fg: var(--sp-blue-200);
    --sp-status-info-border: #2C4580;
    --sp-status-info-solid: var(--sp-blue-300);
    --sp-status-info-on-solid: var(--sp-neutral-950);
    --sp-status-neutral-bg: #2E2C25;
    --sp-status-neutral-fg: var(--sp-neutral-300);
    --sp-status-neutral-border: #4F4B3F;
    --sp-status-neutral-solid: var(--sp-neutral-300);
    --sp-status-neutral-on-solid: var(--sp-neutral-950);
    --sp-focus-ring-color: var(--sp-yellow-300);
    --sp-shadow-color: 0 0 0;
    --sp-shadow-1: 0 1px 2px rgb(var(--sp-shadow-color) / 0.4), 0 1px 3px rgb(var(--sp-shadow-color) / 0.4);
    --sp-shadow-2: 0 2px 4px rgb(var(--sp-shadow-color) / 0.35), 0 6px 16px rgb(var(--sp-shadow-color) / 0.45);
    --sp-shadow-3: 0 4px 8px rgb(var(--sp-shadow-color) / 0.4), 0 12px 28px rgb(var(--sp-shadow-color) / 0.55);
    --sp-shadow-4: 0 8px 16px rgb(var(--sp-shadow-color) / 0.45), 0 24px 48px rgb(var(--sp-shadow-color) / 0.65);
    --sp-shadow-sheet: 0 -8px 32px rgb(var(--sp-shadow-color) / 0.6);
  }
}
:root[data-theme="dark"] {
  --sp-color-bg: var(--sp-neutral-950);
  --sp-color-surface: var(--sp-neutral-900);
  --sp-color-surface-raised: #27251D;
  --sp-color-surface-sunken: #0E0D09;
  --sp-color-surface-inverse: var(--sp-neutral-100);
  --sp-color-surface-hover: rgb(255 244 214 / 0.06);
  --sp-color-surface-pressed: rgb(255 244 214 / 0.12);
  --sp-color-surface-selected: rgb(254 192 6 / 0.16);
  --sp-color-overlay: rgb(0 0 0 / 0.62);
  --sp-color-scrim-media: rgb(20 19 14 / 0.64);
  --sp-color-skeleton-base: #2A2820;
  --sp-color-skeleton-shine: #37342A;
  --sp-color-text: var(--sp-neutral-100);
  --sp-color-text-secondary: #CFCAB9;
  --sp-color-text-tertiary: #A8A396;
  --sp-color-text-disabled: #6B6557;
  --sp-color-text-on-brand: var(--sp-neutral-900);
  --sp-color-text-on-dark: #FFFFFF;
  --sp-color-text-inverse: var(--sp-neutral-900);
  --sp-color-text-brand: var(--sp-yellow-300);
  --sp-color-border: #38352B;
  --sp-color-border-strong: #4F4B3F;
  --sp-color-border-control: #857F70;
  --sp-color-border-selected: var(--sp-neutral-100);
  --sp-color-border-focus: var(--sp-yellow-300);
  --sp-color-brand: var(--sp-yellow-500);
  --sp-color-brand-hover: var(--sp-yellow-400);
  --sp-color-brand-pressed: var(--sp-yellow-600);
  --sp-color-brand-disabled: #38352B;
  --sp-color-on-brand: var(--sp-neutral-900);
  --sp-color-on-brand-disabled: #A8A396;
  --sp-color-brand-soft: rgb(254 192 6 / 0.14);
  --sp-color-brand-soft-border: rgb(254 192 6 / 0.4);
  --sp-color-action-secondary: var(--sp-neutral-100);
  --sp-color-action-secondary-hover: var(--sp-neutral-200);
  --sp-color-action-secondary-pressed: var(--sp-neutral-300);
  --sp-color-on-action-secondary: var(--sp-neutral-900);
  --sp-color-link: #8FB0F5;
  --sp-color-link-hover: #BBD0FA;
  --sp-status-success-bg: #17301A;
  --sp-status-success-fg: var(--sp-green-200);
  --sp-status-success-border: #2E5A31;
  --sp-status-success-solid: var(--sp-green-300);
  --sp-status-success-on-solid: var(--sp-neutral-950);
  --sp-status-warning-bg: #3E2210;
  --sp-status-warning-fg: var(--sp-orange-200);
  --sp-status-warning-border: #6F3F1D;
  --sp-status-warning-solid: var(--sp-orange-300);
  --sp-status-warning-on-solid: var(--sp-neutral-950);
  --sp-status-danger-bg: #3B1A16;
  --sp-status-danger-fg: var(--sp-red-200);
  --sp-status-danger-border: #6A2E27;
  --sp-status-danger-solid: var(--sp-red-300);
  --sp-status-danger-on-solid: var(--sp-neutral-950);
  --sp-status-info-bg: #18274A;
  --sp-status-info-fg: var(--sp-blue-200);
  --sp-status-info-border: #2C4580;
  --sp-status-info-solid: var(--sp-blue-300);
  --sp-status-info-on-solid: var(--sp-neutral-950);
  --sp-status-neutral-bg: #2E2C25;
  --sp-status-neutral-fg: var(--sp-neutral-300);
  --sp-status-neutral-border: #4F4B3F;
  --sp-status-neutral-solid: var(--sp-neutral-300);
  --sp-status-neutral-on-solid: var(--sp-neutral-950);
  --sp-focus-ring-color: var(--sp-yellow-300);
  --sp-shadow-color: 0 0 0;
  --sp-shadow-1: 0 1px 2px rgb(var(--sp-shadow-color) / 0.4), 0 1px 3px rgb(var(--sp-shadow-color) / 0.4);
  --sp-shadow-2: 0 2px 4px rgb(var(--sp-shadow-color) / 0.35), 0 6px 16px rgb(var(--sp-shadow-color) / 0.45);
  --sp-shadow-3: 0 4px 8px rgb(var(--sp-shadow-color) / 0.4), 0 12px 28px rgb(var(--sp-shadow-color) / 0.55);
  --sp-shadow-4: 0 8px 16px rgb(var(--sp-shadow-color) / 0.45), 0 24px 48px rgb(var(--sp-shadow-color) / 0.65);
  --sp-shadow-sheet: 0 -8px 32px rgb(var(--sp-shadow-color) / 0.6);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Responsive steps ---------- */
@media (min-width: 768px) {
  :root {
    --sp-gutter: 24px;
    --sp-gap-section: var(--sp-space-12);
    --sp-pad-card: var(--sp-space-5);
    --sp-text-display-size: 2.75rem;   --sp-text-display-lh: 3.125rem;
    --sp-text-title-1-size: 2rem;      --sp-text-title-1-lh: 2.5rem;
    --sp-text-title-2-size: 1.5rem;    --sp-text-title-2-lh: 2rem;
    --sp-text-price-lg-size: 2rem;     --sp-text-price-lg-lh: 2.25rem;
    --sp-text-title-3-size: 1.125rem;  --sp-text-title-3-lh: 1.5rem;
    --sp-text-body-lh: 1.5rem;
    --sp-text-price-size: 1.25rem;
    --sp-header-h: 3.5rem;
    --sp-control-h: 48px;
    --sp-row-h: 56px;
  }
}
@media (min-width: 1024px) {
  :root { --sp-gutter: 32px; --sp-gap-section: var(--sp-space-16); }
}

/* ---------- Density: compact is for host/admin data views on a precise pointer ONLY ---------- */
@media (hover: hover) and (pointer: fine) {
  [data-density="compact"] {
    --sp-control-h: 40px;
    --sp-control-h-sm: 36px;
    --sp-control-px: 16px;
    --sp-control-px-sm: 12px;
    --sp-control-gap: 6px;
    --sp-row-h: 44px;
    --sp-radius-control: var(--sp-radius-2);
    --sp-pad-card: var(--sp-space-4);
    --sp-text-control-size: var(--sp-text-body-sm-size);
    --sp-text-control-lh: var(--sp-text-body-sm-lh);
  }
}

/* ---------- Motion primitives (keyframes read tokens only) ---------- */
@keyframes sp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes sp-rise-in { from { opacity: 0; transform: translateY(var(--sp-motion-distance-small)); } to { opacity: 1; transform: none; } }
@keyframes sp-sheet-in { from { transform: translateY(var(--sp-motion-distance-sheet)); } to { transform: none; } }
@keyframes sp-sheet-out { from { transform: none; } to { transform: translateY(var(--sp-motion-distance-sheet)); } }
@keyframes sp-scale-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes sp-toast-in { from { opacity: 0; transform: translateY(calc(var(--sp-motion-distance-small) * 2)); } to { opacity: 1; transform: none; } }
@keyframes sp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes sp-spin { to { transform: rotate(360deg); } }
@keyframes sp-pulse { 50% { opacity: 0.55; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --sp-dur-instant: 1ms; --sp-dur-fast: 1ms; --sp-dur-base: 1ms;
    --sp-dur-moderate: 1ms; --sp-dur-slow: 1ms; --sp-dur-slower: 1ms;
    --sp-spring-snappy: linear; --sp-spring-snappy-dur: 1ms;
    --sp-spring-smooth: linear; --sp-spring-smooth-dur: 1ms;
    --sp-spring-bouncy: linear; --sp-spring-bouncy-dur: 1ms;
    --sp-motion-distance-sheet: 0px;
    --sp-motion-distance-small: 0px;
    --sp-loop-count: 1;          /* shimmer and pulse stop after one pass */
    --sp-spin-dur: 2400ms;       /* a spinner is essential feedback: keep it, slow */
    --sp-map-pin-scale-active: 1;
  }
  /* safety net for code that ignores the tokens; the ONLY !important in the system */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .sp-spinner, [data-sp-essential-motion] {
    animation-duration: var(--sp-spin-dur) !important;
    animation-iteration-count: infinite !important;
  }
}

/* ---------- Tiny helpers (the only non-token rules) ---------- */
:where(:focus-visible) {
  outline: var(--sp-focus-ring);
  outline-offset: var(--sp-focus-ring-offset);
}
:where(.sp-num) { font-variant-numeric: var(--sp-numeric-features); }
