/*
 * apple-tokens.css: Apple HIG design tokens for the web (iOS/iPadOS 26–27 "Liquid Glass" look)
 * Part of the apple-design skill. Sept 2026.
 *
 * - System colors, grays and type sizes are the published HIG values (Color / Typography specs).
 * - Semantic colors, radii, materials, glass and row metrics are approximations (≈) of the native look.
 * - Light/dark follow the OS (prefers-color-scheme). Force a theme with <html data-theme="light|dark">.
 * - Increased contrast follows prefers-contrast: more. Force it with <html data-contrast="more">.
 * - Text scales with the user's font settings. On iOS Safari it follows Dynamic Type (see "Type").
 * - Never embed SF font files on the web: the stack below renders SF on Apple devices through the system.
 *
 * Usage: <link rel="stylesheet" href="apple-tokens.css"> then use var(--apple-*) everywhere.
 * Viewport: <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
 */

/* ============================================================ Fonts, type, space, shape */
:root {
  color-scheme: light dark;

  /* ---- Font stacks (SF via the system on Apple devices; sensible fallbacks elsewhere) */
  --apple-font-text: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --apple-font-display: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --apple-font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --apple-font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --apple-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* SF Hebrew on Apple devices; Rubik/Heebo are good open fallbacks elsewhere */
  --apple-font-hebrew: -apple-system, system-ui, BlinkMacSystemFont, "SF Hebrew", "Rubik", "Heebo",
    "Arial Hebrew", Arial, sans-serif;

  /* ---- Type scale: iOS text styles at the default "Large" size, relative to Body (1rem = 17px) */
  --apple-text-large-title: 2rem;        /* 34 / 41 */
  --apple-text-title1: 1.6471rem;        /* 28 / 34 */
  --apple-text-title2: 1.2941rem;        /* 22 / 28 */
  --apple-text-title3: 1.1765rem;        /* 20 / 25 */
  --apple-text-headline: 1rem;           /* 17 / 22 semibold */
  --apple-text-body: 1rem;               /* 17 / 22 */
  --apple-text-callout: 0.9412rem;       /* 16 / 21 */
  --apple-text-subheadline: 0.8824rem;   /* 15 / 20 */
  --apple-text-footnote: 0.7647rem;      /* 13 / 18 */
  --apple-text-caption1: 0.7059rem;      /* 12 / 16 */
  --apple-text-caption2: 0.6471rem;      /* 11 / 13 */

  --apple-leading-large-title: 1.206;
  --apple-leading-title1: 1.214;
  --apple-leading-title2: 1.273;
  --apple-leading-title3: 1.25;
  --apple-leading-body: 1.294;           /* headline + body */
  --apple-leading-callout: 1.313;
  --apple-leading-subheadline: 1.333;
  --apple-leading-footnote: 1.385;
  --apple-leading-caption1: 1.333;
  --apple-leading-caption2: 1.182;

  /* SF Pro tracking at those sizes (HIG table, 1/1000 em). Zeroed for Hebrew/Arabic below. */
  --apple-tracking-large-title: 0.012em;
  --apple-tracking-title1: 0.014em;
  --apple-tracking-title2: -0.012em;
  --apple-tracking-title3: -0.023em;
  --apple-tracking-body: -0.026em;
  --apple-tracking-callout: -0.02em;
  --apple-tracking-subheadline: -0.016em;
  --apple-tracking-footnote: -0.006em;
  --apple-tracking-caption1: 0em;
  --apple-tracking-caption2: 0.006em;

  --apple-weight-regular: 400;
  --apple-weight-medium: 500;
  --apple-weight-semibold: 600;
  --apple-weight-bold: 700;

  /* ---- Spacing (pt ≈ CSS px on Apple devices) */
  --apple-space-1: 4px;
  --apple-space-2: 8px;
  --apple-space-3: 12px;
  --apple-space-4: 16px;
  --apple-space-5: 20px;
  --apple-space-6: 24px;
  --apple-space-8: 32px;
  --apple-space-10: 40px;
  --apple-space-12: 48px;
  --apple-margin: 16px;                  /* layout margin, compact width */
  --apple-readable-width: 672px;         /* ≈ readable content guide */
  --apple-hit-target: 44px;              /* minimum comfortable target */
  --apple-row-min-height: 52px;          /* ≈ iOS 26+ list rows (classic: 44px) */

  /* ---- Shape (≈). Buttons, bars and fields are capsules in the Liquid Glass design. */
  --apple-radius-xs: 6px;
  --apple-radius-sm: 10px;
  --apple-radius-md: 14px;
  --apple-radius-lg: 20px;
  --apple-radius-group: 26px;            /* inset-grouped list sections, cards */
  --apple-radius-sheet: 34px;            /* floating partial-height sheets, alerts */
  --apple-radius-capsule: 999px;
  /* Concentric rule: inner radius = outer radius - inset */

  /* ---- Safe areas (need viewport-fit=cover) */
  --apple-safe-top: env(safe-area-inset-top, 0px);
  --apple-safe-bottom: env(safe-area-inset-bottom, 0px);
  --apple-safe-left: env(safe-area-inset-left, 0px);
  --apple-safe-right: env(safe-area-inset-right, 0px);

  /* ---- Elevation (used sparingly; floating glass only) */
  --apple-shadow-float: 0 8px 28px rgb(0 0 0 / 0.12), 0 1px 3px rgb(0 0 0 / 0.08);
  --apple-shadow-card: 0 1px 2px rgb(0 0 0 / 0.04);
  --apple-dim: rgb(0 0 0 / 0.2);         /* modal backdrop */
}

@media (min-width: 430px) {
  :root { --apple-margin: 20px; }        /* Max-size phones, tablets */
}

/* Tracking is SF Pro specific: don't letter-space Hebrew or Arabic */
:lang(he), :lang(ar) {
  --apple-tracking-large-title: 0em; --apple-tracking-title1: 0em; --apple-tracking-title2: 0em;
  --apple-tracking-title3: 0em; --apple-tracking-body: 0em; --apple-tracking-callout: 0em;
  --apple-tracking-subheadline: 0em; --apple-tracking-footnote: 0em; --apple-tracking-caption1: 0em;
  --apple-tracking-caption2: 0em;
}

/* Root size: 17px body that still honors the user's browser font size (106.25% of 16px) */
html { font-size: 106.25%; }

/* iOS/iPadOS Safari: follow Dynamic Type (Settings › Display & Text Size). Touch devices only,
   because -apple-system-body is 13px on macOS. */
@supports (font: -apple-system-body) {
  @media (hover: none) and (pointer: coarse) {
    html { font: -apple-system-body; }
  }
}

/* ============================================================ Motion */
:root {
  /* Springs sampled from SwiftUI's spring model (perceptual duration 0.5 s) as CSS linear() easings.
     Use the paired duration: the time the spring takes to settle. */
/* BEGIN GENERATED MOTION */
  --apple-spring-smooth: linear(0, 0.02, 0.069, 0.136, 0.211, 0.289, 0.367, 0.441, 0.51, 0.573, 0.63, 0.68, 0.725, 0.765, 0.799, 0.829, 0.855, 0.877, 0.896, 0.913, 0.926, 0.938, 0.948, 0.957, 0.964, 0.97, 0.975, 0.979, 0.982, 0.985, 0.988, 0.99, 0.992, 0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 1);
  --apple-spring-smooth-duration: 680ms;
  --apple-spring-snappy: linear(0, 0.019, 0.066, 0.133, 0.21, 0.292, 0.375, 0.456, 0.532, 0.602, 0.666, 0.723, 0.772, 0.816, 0.853, 0.884, 0.91, 0.932, 0.949, 0.964, 0.975, 0.984, 0.991, 0.996, 1, 1.003, 1.004, 1.005, 1.006, 1.006, 1.006, 1.006, 1.006, 1.005, 1.005, 1.004, 1.004, 1.003, 1.003, 1.002, 1);
  --apple-spring-snappy-duration: 650ms;
  --apple-spring-bouncy: linear(0, 0.024, 0.087, 0.173, 0.274, 0.38, 0.485, 0.585, 0.676, 0.756, 0.826, 0.884, 0.931, 0.968, 0.997, 1.018, 1.032, 1.04, 1.045, 1.046, 1.045, 1.042, 1.038, 1.033, 1.028, 1.023, 1.019, 1.015, 1.011, 1.008, 1.005, 1.003, 1.001, 1, 0.999, 0.999, 0.998, 0.998, 0.998, 0.998, 1);
  --apple-spring-bouncy-duration: 740ms;
  --apple-spring-quick: linear(0, 0.02, 0.07, 0.137, 0.212, 0.291, 0.369, 0.443, 0.512, 0.575, 0.632, 0.683, 0.728, 0.767, 0.802, 0.831, 0.857, 0.879, 0.898, 0.914, 0.928, 0.939, 0.949, 0.957, 0.964, 0.97, 0.975, 0.979, 0.983, 0.986, 0.988, 0.99, 0.992, 0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 1);
  --apple-spring-quick-duration: 410ms;
/* END GENERATED MOTION */
  --apple-ease-standard: cubic-bezier(0.25, 0.1, 0.25, 1);
  --apple-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --apple-duration-fast: 150ms;          /* hover/press feedback */
  --apple-duration-base: 250ms;          /* small state changes */
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --apple-spring-smooth: linear(0, 1); --apple-spring-snappy: linear(0, 1);
    --apple-spring-bouncy: linear(0, 1); --apple-spring-quick: linear(0, 1);
    --apple-spring-smooth-duration: 1ms; --apple-spring-snappy-duration: 1ms;
    --apple-spring-bouncy-duration: 1ms; --apple-spring-quick-duration: 1ms;
    --apple-duration-fast: 1ms; --apple-duration-base: 1ms;
  }
}

/* ============================================================ Color */
/* BEGIN GENERATED COLORS */
/* Light (default) */
:root {
  --apple-red: #FF383C;
  --apple-orange: #FF8D28;
  --apple-yellow: #FFCC00;
  --apple-green: #34C759;
  --apple-mint: #00C8B3;
  --apple-teal: #00C3D0;
  --apple-cyan: #00C0E8;
  --apple-blue: #0088FF;
  --apple-indigo: #6155F5;
  --apple-purple: #CB30E0;
  --apple-pink: #FF2D55;
  --apple-brown: #AC7F5E;
  --apple-system-gray: #8E8E93;
  --apple-system-gray2: #AEAEB2;
  --apple-system-gray3: #C7C7CC;
  --apple-system-gray4: #D1D1D6;
  --apple-system-gray5: #E5E5EA;
  --apple-system-gray6: #F2F2F7;
  --apple-label: #000000;
  --apple-secondary-label: rgba(60, 60, 67, 0.6);
  --apple-tertiary-label: rgba(60, 60, 67, 0.3);
  --apple-quaternary-label: rgba(60, 60, 67, 0.18);
  --apple-placeholder-text: rgba(60, 60, 67, 0.3);
  --apple-separator: rgba(60, 60, 67, 0.29);
  --apple-opaque-separator: #C6C6C8;
  --apple-link: #0088FF;
  --apple-system-background: #FFFFFF;
  --apple-secondary-system-background: #F2F2F7;
  --apple-tertiary-system-background: #FFFFFF;
  --apple-system-grouped-background: #F2F2F7;
  --apple-secondary-system-grouped-background: #FFFFFF;
  --apple-tertiary-system-grouped-background: #F2F2F7;
  --apple-system-fill: rgba(120, 120, 128, 0.2);
  --apple-secondary-system-fill: rgba(120, 120, 128, 0.16);
  --apple-tertiary-system-fill: rgba(118, 118, 128, 0.12);
  --apple-quaternary-system-fill: rgba(116, 116, 128, 0.08);
  --apple-system-background-elevated: #FFFFFF;
  --apple-secondary-system-background-elevated: #F2F2F7;
  --apple-tertiary-system-background-elevated: #FFFFFF;
  --apple-system-grouped-background-elevated: #F2F2F7;
  --apple-secondary-system-grouped-background-elevated: #FFFFFF;
}
/* Dark: follows the OS unless data-theme="light"; data-theme="dark" forces it */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --apple-red: #FF4245;
    --apple-orange: #FF9230;
    --apple-yellow: #FFD600;
    --apple-green: #30D158;
    --apple-mint: #00DAC3;
    --apple-teal: #00D2E0;
    --apple-cyan: #3CD3FE;
    --apple-blue: #0091FF;
    --apple-indigo: #6D7CFF;
    --apple-purple: #DB34F2;
    --apple-pink: #FF375F;
    --apple-brown: #B78A66;
    --apple-system-gray: #8E8E93;
    --apple-system-gray2: #636366;
    --apple-system-gray3: #48484A;
    --apple-system-gray4: #3A3A3C;
    --apple-system-gray5: #2C2C2E;
    --apple-system-gray6: #1C1C1E;
    --apple-label: #FFFFFF;
    --apple-secondary-label: rgba(235, 235, 245, 0.6);
    --apple-tertiary-label: rgba(235, 235, 245, 0.3);
    --apple-quaternary-label: rgba(235, 235, 245, 0.16);
    --apple-placeholder-text: rgba(235, 235, 245, 0.3);
    --apple-separator: rgba(84, 84, 88, 0.6);
    --apple-opaque-separator: #38383A;
    --apple-link: #0091FF;
    --apple-system-background: #000000;
    --apple-secondary-system-background: #1C1C1E;
    --apple-tertiary-system-background: #2C2C2E;
    --apple-system-grouped-background: #000000;
    --apple-secondary-system-grouped-background: #1C1C1E;
    --apple-tertiary-system-grouped-background: #2C2C2E;
    --apple-system-fill: rgba(120, 120, 128, 0.36);
    --apple-secondary-system-fill: rgba(120, 120, 128, 0.32);
    --apple-tertiary-system-fill: rgba(118, 118, 128, 0.24);
    --apple-quaternary-system-fill: rgba(118, 118, 128, 0.18);
    --apple-system-background-elevated: #1C1C1E;
    --apple-secondary-system-background-elevated: #2C2C2E;
    --apple-tertiary-system-background-elevated: #3A3A3C;
    --apple-system-grouped-background-elevated: #1C1C1E;
    --apple-secondary-system-grouped-background-elevated: #2C2C2E;
  }
}
:root[data-theme="dark"] {
  --apple-red: #FF4245;
  --apple-orange: #FF9230;
  --apple-yellow: #FFD600;
  --apple-green: #30D158;
  --apple-mint: #00DAC3;
  --apple-teal: #00D2E0;
  --apple-cyan: #3CD3FE;
  --apple-blue: #0091FF;
  --apple-indigo: #6D7CFF;
  --apple-purple: #DB34F2;
  --apple-pink: #FF375F;
  --apple-brown: #B78A66;
  --apple-system-gray: #8E8E93;
  --apple-system-gray2: #636366;
  --apple-system-gray3: #48484A;
  --apple-system-gray4: #3A3A3C;
  --apple-system-gray5: #2C2C2E;
  --apple-system-gray6: #1C1C1E;
  --apple-label: #FFFFFF;
  --apple-secondary-label: rgba(235, 235, 245, 0.6);
  --apple-tertiary-label: rgba(235, 235, 245, 0.3);
  --apple-quaternary-label: rgba(235, 235, 245, 0.16);
  --apple-placeholder-text: rgba(235, 235, 245, 0.3);
  --apple-separator: rgba(84, 84, 88, 0.6);
  --apple-opaque-separator: #38383A;
  --apple-link: #0091FF;
  --apple-system-background: #000000;
  --apple-secondary-system-background: #1C1C1E;
  --apple-tertiary-system-background: #2C2C2E;
  --apple-system-grouped-background: #000000;
  --apple-secondary-system-grouped-background: #1C1C1E;
  --apple-tertiary-system-grouped-background: #2C2C2E;
  --apple-system-fill: rgba(120, 120, 128, 0.36);
  --apple-secondary-system-fill: rgba(120, 120, 128, 0.32);
  --apple-tertiary-system-fill: rgba(118, 118, 128, 0.24);
  --apple-quaternary-system-fill: rgba(118, 118, 128, 0.18);
  --apple-system-background-elevated: #1C1C1E;
  --apple-secondary-system-background-elevated: #2C2C2E;
  --apple-tertiary-system-background-elevated: #3A3A3C;
  --apple-system-grouped-background-elevated: #1C1C1E;
  --apple-secondary-system-grouped-background-elevated: #2C2C2E;
}
/* Increased contrast (prefers-contrast: more, or data-contrast="more") */
@media (prefers-contrast: more) {
  :root {
    --apple-red: #E9152D;
    --apple-orange: #C55300;
    --apple-yellow: #A16A00;
    --apple-green: #008932;
    --apple-mint: #008575;
    --apple-teal: #008198;
    --apple-cyan: #007EAE;
    --apple-blue: #1E6EF4;
    --apple-indigo: #564ADE;
    --apple-purple: #B02FC2;
    --apple-pink: #E7124D;
    --apple-brown: #956D51;
    --apple-system-gray: #6C6C70;
    --apple-system-gray2: #8E8E93;
    --apple-system-gray3: #AEAEB2;
    --apple-system-gray4: #BCBCC0;
    --apple-system-gray5: #D8D8DC;
    --apple-system-gray6: #EBEBF0;
    --apple-secondary-label: rgba(60, 60, 67, 0.8);
    --apple-tertiary-label: rgba(60, 60, 67, 0.6);
    --apple-separator: rgba(60, 60, 67, 0.55);
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --apple-red: #FF6165;
    --apple-orange: #FFA056;
    --apple-yellow: #FEDF43;
    --apple-green: #4AD968;
    --apple-mint: #54DFCB;
    --apple-teal: #3BDDEC;
    --apple-cyan: #6DD9FF;
    --apple-blue: #5CB8FF;
    --apple-indigo: #A7AAFF;
    --apple-purple: #EA8DFF;
    --apple-pink: #FF8AC4;
    --apple-brown: #DBA679;
    --apple-system-gray: #AEAEB2;
    --apple-system-gray2: #7C7C80;
    --apple-system-gray3: #545456;
    --apple-system-gray4: #444446;
    --apple-system-gray5: #363638;
    --apple-system-gray6: #242426;
    --apple-secondary-label: rgba(235, 235, 245, 0.8);
    --apple-tertiary-label: rgba(235, 235, 245, 0.6);
    --apple-separator: rgba(84, 84, 88, 0.9);
  }
}
@media (prefers-contrast: more) {
  :root[data-theme="dark"] {
    --apple-red: #FF6165;
    --apple-orange: #FFA056;
    --apple-yellow: #FEDF43;
    --apple-green: #4AD968;
    --apple-mint: #54DFCB;
    --apple-teal: #3BDDEC;
    --apple-cyan: #6DD9FF;
    --apple-blue: #5CB8FF;
    --apple-indigo: #A7AAFF;
    --apple-purple: #EA8DFF;
    --apple-pink: #FF8AC4;
    --apple-brown: #DBA679;
    --apple-system-gray: #AEAEB2;
    --apple-system-gray2: #7C7C80;
    --apple-system-gray3: #545456;
    --apple-system-gray4: #444446;
    --apple-system-gray5: #363638;
    --apple-system-gray6: #242426;
    --apple-secondary-label: rgba(235, 235, 245, 0.8);
    --apple-tertiary-label: rgba(235, 235, 245, 0.6);
    --apple-separator: rgba(84, 84, 88, 0.9);
  }
}
:root[data-contrast="more"] {
  --apple-red: #E9152D;
  --apple-orange: #C55300;
  --apple-yellow: #A16A00;
  --apple-green: #008932;
  --apple-mint: #008575;
  --apple-teal: #008198;
  --apple-cyan: #007EAE;
  --apple-blue: #1E6EF4;
  --apple-indigo: #564ADE;
  --apple-purple: #B02FC2;
  --apple-pink: #E7124D;
  --apple-brown: #956D51;
  --apple-system-gray: #6C6C70;
  --apple-system-gray2: #8E8E93;
  --apple-system-gray3: #AEAEB2;
  --apple-system-gray4: #BCBCC0;
  --apple-system-gray5: #D8D8DC;
  --apple-system-gray6: #EBEBF0;
  --apple-secondary-label: rgba(60, 60, 67, 0.8);
  --apple-tertiary-label: rgba(60, 60, 67, 0.6);
  --apple-separator: rgba(60, 60, 67, 0.55);
}
:root[data-contrast="more"][data-theme="dark"] {
  --apple-red: #FF6165;
  --apple-orange: #FFA056;
  --apple-yellow: #FEDF43;
  --apple-green: #4AD968;
  --apple-mint: #54DFCB;
  --apple-teal: #3BDDEC;
  --apple-cyan: #6DD9FF;
  --apple-blue: #5CB8FF;
  --apple-indigo: #A7AAFF;
  --apple-purple: #EA8DFF;
  --apple-pink: #FF8AC4;
  --apple-brown: #DBA679;
  --apple-system-gray: #AEAEB2;
  --apple-system-gray2: #7C7C80;
  --apple-system-gray3: #545456;
  --apple-system-gray4: #444446;
  --apple-system-gray5: #363638;
  --apple-system-gray6: #242426;
  --apple-secondary-label: rgba(235, 235, 245, 0.8);
  --apple-tertiary-label: rgba(235, 235, 245, 0.6);
  --apple-separator: rgba(84, 84, 88, 0.9);
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="more"]:not([data-theme="light"]) {
    --apple-red: #FF6165;
    --apple-orange: #FFA056;
    --apple-yellow: #FEDF43;
    --apple-green: #4AD968;
    --apple-mint: #54DFCB;
    --apple-teal: #3BDDEC;
    --apple-cyan: #6DD9FF;
    --apple-blue: #5CB8FF;
    --apple-indigo: #A7AAFF;
    --apple-purple: #EA8DFF;
    --apple-pink: #FF8AC4;
    --apple-brown: #DBA679;
    --apple-system-gray: #AEAEB2;
    --apple-system-gray2: #7C7C80;
    --apple-system-gray3: #545456;
    --apple-system-gray4: #444446;
    --apple-system-gray5: #363638;
    --apple-system-gray6: #242426;
    --apple-secondary-label: rgba(235, 235, 245, 0.8);
    --apple-tertiary-label: rgba(235, 235, 245, 0.6);
    --apple-separator: rgba(84, 84, 88, 0.9);
  }
}
/* END GENERATED COLORS */

/* Accent (tint). Override --apple-accent for your brand; keep light/dark/contrast variants. */
:root {
  --apple-accent: var(--apple-blue);
  --apple-on-accent: #FFFFFF;
  --apple-destructive: var(--apple-red);
  --apple-success: var(--apple-green);
  --apple-warning: var(--apple-orange);
}

/* ============================================================ Materials & Liquid Glass (≈) */
/* Standard materials: content layer (cards over imagery, overlays). Thicker = more contrast. */
:root {
  --apple-material-ultrathin: rgb(255 255 255 / 0.36);
  --apple-material-thin: rgb(255 255 255 / 0.55);
  --apple-material-regular: rgb(250 250 252 / 0.72);
  --apple-material-thick: rgb(250 250 252 / 0.86);
  --apple-material-filter: blur(24px) saturate(180%);

  /* Liquid Glass: functional layer only (bars, tab bars, floating buttons, menus, sheets) */
  --apple-glass-fill: rgb(255 255 255 / 0.5);             /* regular: legible text on anything */
  --apple-glass-fill-clear: rgb(255 255 255 / 0.12);      /* clear: over rich media only */
  --apple-glass-filter: blur(14px) saturate(190%) brightness(1.06);
  --apple-glass-filter-clear: blur(3px) saturate(160%) brightness(1.08);
  --apple-glass-rim: rgb(255 255 255 / 0.75);             /* specular edge highlight */
  --apple-glass-rim-soft: rgb(255 255 255 / 0.18);
  --apple-glass-edge: rgb(0 0 0 / 0.08);                  /* outer hairline */
  --apple-glass-shadow: 0 6px 24px rgb(0 0 0 / 0.12), 0 1px 2px rgb(0 0 0 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --apple-material-ultrathin: rgb(40 40 44 / 0.36);
    --apple-material-thin: rgb(40 40 44 / 0.55);
    --apple-material-regular: rgb(32 32 36 / 0.72);
    --apple-material-thick: rgb(28 28 30 / 0.88);
    --apple-glass-fill: rgb(44 44 48 / 0.5);
    --apple-glass-fill-clear: rgb(30 30 34 / 0.18);
    --apple-glass-rim: rgb(255 255 255 / 0.28);
    --apple-glass-rim-soft: rgb(255 255 255 / 0.06);
    --apple-glass-edge: rgb(255 255 255 / 0.08);
    --apple-glass-shadow: 0 6px 24px rgb(0 0 0 / 0.4), 0 1px 2px rgb(0 0 0 / 0.3);
    --apple-shadow-float: 0 8px 28px rgb(0 0 0 / 0.45), 0 1px 3px rgb(0 0 0 / 0.3);
    --apple-dim: rgb(0 0 0 / 0.45);
  }
}
:root[data-theme="dark"] {
  --apple-material-ultrathin: rgb(40 40 44 / 0.36);
  --apple-material-thin: rgb(40 40 44 / 0.55);
  --apple-material-regular: rgb(32 32 36 / 0.72);
  --apple-material-thick: rgb(28 28 30 / 0.88);
  --apple-glass-fill: rgb(44 44 48 / 0.5);
  --apple-glass-fill-clear: rgb(30 30 34 / 0.18);
  --apple-glass-rim: rgb(255 255 255 / 0.28);
  --apple-glass-rim-soft: rgb(255 255 255 / 0.06);
  --apple-glass-edge: rgb(255 255 255 / 0.08);
  --apple-glass-shadow: 0 6px 24px rgb(0 0 0 / 0.4), 0 1px 2px rgb(0 0 0 / 0.3);
  --apple-shadow-float: 0 8px 28px rgb(0 0 0 / 0.45), 0 1px 3px rgb(0 0 0 / 0.3);
  --apple-dim: rgb(0 0 0 / 0.45);
}

/* Reduce Transparency / older engines: frosted-opaque surfaces instead of see-through glass */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --apple-glass-fill: var(--apple-secondary-system-background);
    --apple-glass-fill-clear: var(--apple-secondary-system-background);
    --apple-material-ultrathin: var(--apple-secondary-system-background);
    --apple-material-thin: var(--apple-secondary-system-background);
    --apple-material-regular: var(--apple-secondary-system-background);
    --apple-material-thick: var(--apple-secondary-system-background);
    --apple-glass-filter: none;
    --apple-glass-filter-clear: none;
    --apple-material-filter: none;
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --apple-glass-fill: var(--apple-secondary-system-background);
    --apple-glass-fill-clear: var(--apple-secondary-system-background);
    --apple-material-regular: var(--apple-secondary-system-background);
    --apple-material-thick: var(--apple-secondary-system-background);
  }
}

/* Increased contrast: glass and materials become more opaque with a visible edge */
@media (prefers-contrast: more) {
  :root {
    --apple-glass-fill: rgb(255 255 255 / 0.86);
    --apple-glass-edge: rgb(0 0 0 / 0.45);
    --apple-material-regular: rgb(250 250 252 / 0.94);
  }
  :root[data-theme="dark"] {
    --apple-glass-fill: rgb(28 28 30 / 0.9);
    --apple-glass-edge: rgb(255 255 255 / 0.5);
    --apple-material-regular: rgb(28 28 30 / 0.95);
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --apple-glass-fill: rgb(28 28 30 / 0.9);
    --apple-glass-edge: rgb(255 255 255 / 0.5);
    --apple-material-regular: rgb(28 28 30 / 0.95);
  }
}
:root[data-contrast="more"] {
  --apple-glass-fill: rgb(255 255 255 / 0.86);
  --apple-glass-edge: rgb(0 0 0 / 0.45);
  --apple-material-regular: rgb(250 250 252 / 0.94);
}
:root[data-contrast="more"][data-theme="dark"] {
  --apple-glass-fill: rgb(28 28 30 / 0.9);
  --apple-glass-edge: rgb(255 255 255 / 0.5);
  --apple-material-regular: rgb(28 28 30 / 0.95);
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="more"]:not([data-theme="light"]) {
    --apple-glass-fill: rgb(28 28 30 / 0.9);
    --apple-glass-edge: rgb(255 255 255 / 0.5);
    --apple-material-regular: rgb(28 28 30 / 0.95);
  }
}
