/* ──────────────────────────────────────────────────────────────────
   swiftui.css — iOS-faithful design system for vphone web
   ──────────────────────────────────────────────────────────────────
   Spec values derived from Framework7's iOS theme (10+ years of
   pixel-perfect iOS reproduction) cross-checked against Apple HIG.
   Default theme is iOS dark mode; iOS light mode activates via
   :root[data-theme="light"]. macOS sizing is available via class
   .ios-mac-density on the page root for compact tools.
   ────────────────────────────────────────────────────────────────── */

/* ╭──────────────────────────────────────────────────────────────╮
   │  Tokens — iOS Dark mode (default)                            │
   ╰──────────────────────────────────────────────────────────────╯ */
:root,
:root[data-theme="dark"] {
  /* System colors — Dark */
  --sw-blue:    #0A84FF;
  --sw-green:   #30D158;
  --sw-indigo:  #5E5CE6;
  --sw-orange:  #FF9F0A;
  --sw-pink:    #FF375F;
  --sw-purple:  #BF5AF2;
  --sw-red:     #FF453A;
  --sw-teal:    #64D2FF;
  --sw-yellow:  #FFD60A;
  --sw-mint:    #66D4CF;
  --sw-cyan:    #64D2FF;
  --sw-brown:   #AC8E68;

  /* RGB triplets for color-mix fallbacks and rgba() use */
  --sw-blue-rgb:   10, 132, 255;
  --sw-green-rgb:  48, 209, 88;
  --sw-red-rgb:    255, 69, 58;
  --sw-orange-rgb: 255, 159, 10;
  --sw-purple-rgb: 191, 90, 242;
  --sw-pink-rgb:   255, 55, 95;
  --sw-teal-rgb:   100, 210, 255;
  --sw-yellow-rgb: 255, 214, 10;
  --sw-indigo-rgb: 94, 92, 230;

  /* System grays — Dark */
  --sw-gray:    #8E8E93;
  --sw-gray2:   #636366;
  --sw-gray3:   #48484A;
  --sw-gray4:   #3A3A3C;
  --sw-gray5:   #2C2C2E;
  --sw-gray6:   #1C1C1E;

  /* Backgrounds — iOS dark */
  --sw-window-bg:                  #000000;        /* iOS systemBackground (dark) */
  --sw-content-bg:                 #1C1C1E;        /* secondarySystemBackground */
  --sw-tertiary-bg:                #2C2C2E;        /* tertiarySystemBackground */
  --sw-grouped-bg:                 #000000;        /* systemGroupedBackground (dark) */
  --sw-secondary-grouped-bg:       #1C1C1E;        /* secondarySystemGroupedBackground */
  --sw-tertiary-grouped-bg:        #2C2C2E;
  --sw-elevated-bg:                #1C1C1E;        /* iOS chrome bar */

  /* Fills — Dark */
  --sw-fill-primary:               rgba(120, 120, 128, 0.36);
  --sw-fill-secondary:             rgba(120, 120, 128, 0.32);
  --sw-fill-tertiary:              rgba(118, 118, 128, 0.24);
  --sw-fill-quaternary:            rgba(118, 118, 128, 0.18);

  /* Labels — Dark */
  --sw-label:                      rgba(255, 255, 255, 1.00);
  --sw-secondary-label:            rgba(235, 235, 245, 0.60);
  --sw-tertiary-label:             rgba(235, 235, 245, 0.30);
  --sw-quaternary-label:           rgba(235, 235, 245, 0.18);
  --sw-placeholder:                rgba(235, 235, 245, 0.30);

  /* Separators — Dark */
  --sw-separator:                  rgba(84, 84, 88, 0.65);
  --sw-opaque-separator:           #38383A;

  /* Selection / control */
  --sw-selected-content-bg:        var(--sw-blue);
  --sw-selected-text-bg:           rgba(10, 132, 255, 0.30);
  --sw-keyboard-focus-ring:        rgba(10, 132, 255, 0.55);

  /* Material / vibrancy approximations (iOS dark) */
  --sw-material-regular-bg:        rgba(28, 28, 30, 0.70);
  --sw-material-regular-blur:      saturate(180%) blur(28px);
  --sw-material-thick-bg:          rgba(28, 28, 30, 0.90);
  --sw-material-thick-blur:        saturate(180%) blur(36px);
  --sw-material-thin-bg:           rgba(28, 28, 30, 0.55);
  --sw-material-thin-blur:         saturate(180%) blur(22px);
  --sw-material-ultra-thin-bg:     rgba(28, 28, 30, 0.30);
  --sw-material-ultra-thin-blur:   saturate(180%) blur(16px);

  /* Shadows */
  --sw-shadow-sm:  0 1px 2px rgba(0,0,0,0.30);
  --sw-shadow-md:  0 4px 12px rgba(0,0,0,0.40), 0 1px 2px rgba(0,0,0,0.30);
  --sw-shadow-lg:  0 16px 36px rgba(0,0,0,0.48), 0 2px 6px rgba(0,0,0,0.35);
  --sw-shadow-xl:  0 30px 60px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.40);

  --sw-control-highlight: inset 0 1px 0 rgba(255,255,255,0.05);

  color-scheme: dark;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Tokens — iOS Light mode                                     │
   ╰──────────────────────────────────────────────────────────────╯ */
:root[data-theme="light"] {
  --sw-blue:    #007AFF;
  --sw-green:   #34C759;
  --sw-indigo:  #5856D6;
  --sw-orange:  #FF9500;
  --sw-pink:    #FF2D55;
  --sw-purple:  #AF52DE;
  --sw-red:     #FF3B30;
  --sw-teal:    #5AC8FA;
  --sw-yellow:  #FFCC00;
  --sw-mint:    #00C7BE;
  --sw-cyan:    #32ADE6;
  --sw-brown:   #A2845E;

  --sw-blue-rgb:   0, 122, 255;
  --sw-green-rgb:  52, 199, 89;
  --sw-red-rgb:    255, 59, 48;
  --sw-orange-rgb: 255, 149, 0;
  --sw-purple-rgb: 175, 82, 222;
  --sw-pink-rgb:   255, 45, 85;
  --sw-teal-rgb:   90, 200, 250;
  --sw-yellow-rgb: 255, 204, 0;
  --sw-indigo-rgb: 88, 86, 214;

  --sw-gray:    #8E8E93;
  --sw-gray2:   #AEAEB2;
  --sw-gray3:   #C7C7CC;
  --sw-gray4:   #D1D1D6;
  --sw-gray5:   #E5E5EA;
  --sw-gray6:   #F2F2F7;

  --sw-window-bg:                  #FFFFFF;
  --sw-content-bg:                 #FFFFFF;
  --sw-tertiary-bg:                #F2F2F7;
  --sw-grouped-bg:                 #F2F2F7;
  --sw-secondary-grouped-bg:       #FFFFFF;
  --sw-tertiary-grouped-bg:        #F2F2F7;
  --sw-elevated-bg:                #FFFFFF;

  --sw-fill-primary:               rgba(120, 120, 128, 0.20);
  --sw-fill-secondary:             rgba(120, 120, 128, 0.16);
  --sw-fill-tertiary:              rgba(118, 118, 128, 0.12);
  --sw-fill-quaternary:            rgba(116, 116, 128, 0.08);

  --sw-label:                      rgba(0, 0, 0, 0.85);
  --sw-secondary-label:            rgba(60, 60, 67, 0.60);
  --sw-tertiary-label:             rgba(60, 60, 67, 0.30);
  --sw-quaternary-label:           rgba(60, 60, 67, 0.18);
  --sw-placeholder:                rgba(60, 60, 67, 0.30);

  --sw-separator:                  rgba(60, 60, 67, 0.29);
  --sw-opaque-separator:           #C6C6C8;

  --sw-selected-content-bg:        var(--sw-blue);
  --sw-selected-text-bg:           rgba(0, 122, 255, 0.22);
  --sw-keyboard-focus-ring:        rgba(0, 122, 255, 0.55);

  --sw-material-regular-bg:        rgba(255, 255, 255, 0.78);
  --sw-material-regular-blur:      saturate(180%) blur(28px);
  --sw-material-thick-bg:          rgba(255, 255, 255, 0.92);
  --sw-material-thick-blur:        saturate(180%) blur(36px);
  --sw-material-thin-bg:           rgba(246, 246, 246, 0.55);
  --sw-material-thin-blur:         saturate(180%) blur(22px);
  --sw-material-ultra-thin-bg:     rgba(246, 246, 246, 0.32);
  --sw-material-ultra-thin-blur:   saturate(180%) blur(16px);

  --sw-shadow-sm:  0 1px 2px rgba(0,0,0,0.10);
  --sw-shadow-md:  0 4px 10px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --sw-shadow-lg:  0 16px 36px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08);
  --sw-shadow-xl:  0 30px 60px rgba(0,0,0,0.20), 0 4px 12px rgba(0,0,0,0.10);

  --sw-control-highlight: inset 0 1px 0 rgba(255,255,255,0.50);

  color-scheme: light;
}

/* Geometry tokens (shared) */
:root {
  /* SF Pro stack — iOS uses SF Pro Display/Text/Rounded */
  --sw-font-text:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "system-ui", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sw-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "system-ui", sans-serif;
  --sw-font-mono:    ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sw-font-rounded: ui-rounded, -apple-system, "SF Pro Rounded", "SF Pro", system-ui, sans-serif;

  /* iOS spacing — 8pt grid with iOS-typical block margins */
  --sw-space-1:  4px;
  --sw-space-2:  8px;
  --sw-space-3:  12px;
  --sw-space-4:  16px;   /* iOS standard padding (block padding-horizontal/vertical) */
  --sw-space-5:  20px;
  --sw-space-6:  24px;
  --sw-space-7:  32px;
  --sw-space-8:  35px;   /* iOS block margin-vertical — section spacing */
  --sw-space-9:  48px;
  --sw-space-10: 64px;

  /* Radii — iOS heavy on rounded; 24px for inset lists/blocks is hallmark iOS */
  --sw-radius-xs:  4px;
  --sw-radius-sm:  6px;
  --sw-radius-md:  8px;
  --sw-radius-lg:  10px;
  --sw-radius-xl:  12px;
  --sw-radius-2xl: 16px;
  --sw-radius-3xl: 20px;
  --sw-radius-inset: 24px;   /* iOS list-inset / block-inset — distinctive */
  --sw-radius-pill: 9999px;

  /* Control heights (iOS) */
  --sw-h-small:   28px;
  --sw-h-regular: 34px;
  --sw-h-large:   48px;
  --sw-h-xl:      56px;

  /* Easing */
  --sw-ease-standard: cubic-bezier(0.25, 0.1, 0.25, 1);
  --sw-ease-emphasis: cubic-bezier(0.32, 0.72, 0, 1);
  --sw-ease-decel:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --sw-ease-accel:    cubic-bezier(0.4, 0.0, 1.0, 1.0);
  --sw-ease-spring:   cubic-bezier(0.5, 1.5, 0.5, 1);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Base reset                                                  │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-root,
body.sw-root {
  font-family: var(--sw-font-text);
  font-size: 17px;            /* iOS body — F7 list-font-size */
  line-height: 1.29;          /* iOS body line-height ratio */
  letter-spacing: -0.022em;   /* iOS optical letter-spacing */
  color: var(--sw-label);
  background: var(--sw-window-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv11";
}

/* Compact/macOS density on demand (e.g., for dense admin tables) */
.sw-density-compact {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: -0.008em;
}

/* Scrollbars — iOS overlay style (thin, faint) */
.sw-root *::-webkit-scrollbar,
.sw-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.sw-root *::-webkit-scrollbar-track,
.sw-scrollbar::-webkit-scrollbar-track { background: transparent; }
.sw-root *::-webkit-scrollbar-thumb,
.sw-scrollbar::-webkit-scrollbar-thumb {
  background: var(--sw-fill-tertiary);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.sw-root *::-webkit-scrollbar-thumb:hover,
.sw-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--sw-fill-secondary);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Typography — iOS text styles                                │
   ╰──────────────────────────────────────────────────────────────╯
   iOS reference (from F7 + Apple HIG):
     largeTitle : 34pt / 41 line / 700 / -0.030em
     title1     : 28pt / 34 line / 700 / -0.026em
     title2     : 22pt / 28 line / 700 / -0.022em
     title3     : 20pt / 25 line / 600 / -0.020em
     headline   : 17pt / 22 line / 600 / -0.020em
     body       : 17pt / 22 line / 400 / -0.020em
     callout    : 16pt / 21 line / 400 / -0.018em
     subheadline: 15pt / 20 line / 400 / -0.014em
     footnote   : 13pt / 18 line / 400 /  -0.008em
     caption    : 12pt / 16 line / 400 /  0
     caption2   : 11pt / 13 line / 400 /  0.006em
*/
.sw-largeTitle  { font-family: var(--sw-font-display); font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.030em; }
.sw-title       { font-family: var(--sw-font-display); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.026em; }
.sw-title2      { font-family: var(--sw-font-display); font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.022em; }
.sw-title3      { font-family: var(--sw-font-display); font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: -0.020em; }
.sw-headline    { font-family: var(--sw-font-text);    font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.020em; }
.sw-body        { font-family: var(--sw-font-text);    font-size: 17px; line-height: 22px; font-weight: 400; letter-spacing: -0.020em; }
.sw-callout     { font-family: var(--sw-font-text);    font-size: 16px; line-height: 21px; font-weight: 400; letter-spacing: -0.018em; }
.sw-subheadline { font-family: var(--sw-font-text);    font-size: 15px; line-height: 20px; font-weight: 400; letter-spacing: -0.014em; }
.sw-footnote    { font-family: var(--sw-font-text);    font-size: 13px; line-height: 18px; font-weight: 400; letter-spacing: -0.008em; }
.sw-caption     { font-family: var(--sw-font-text);    font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: 0; }
.sw-caption2    { font-family: var(--sw-font-text);    font-size: 11px; line-height: 13px; font-weight: 400; letter-spacing: 0.006em; }

/* Weight + variant utilities */
.sw-w-regular  { font-weight: 400; }
.sw-w-medium   { font-weight: 500; }
.sw-w-semibold { font-weight: 600; }
.sw-w-bold     { font-weight: 700; }
.sw-w-heavy    { font-weight: 800; }
.sw-mono       { font-family: var(--sw-font-mono); font-feature-settings: "tnum"; }
.sw-rounded    { font-family: var(--sw-font-rounded); }
.sw-tabular    { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sw-uppercase  { text-transform: uppercase; letter-spacing: 0.06em; }

/* Color utilities (foreground) */
.sw-fg              { color: var(--sw-label); }
.sw-fg-secondary    { color: var(--sw-secondary-label); }
.sw-fg-tertiary     { color: var(--sw-tertiary-label); }
.sw-fg-quaternary   { color: var(--sw-quaternary-label); }
.sw-fg-placeholder  { color: var(--sw-placeholder); }
.sw-fg-blue     { color: var(--sw-blue); }
.sw-fg-green    { color: var(--sw-green); }
.sw-fg-red      { color: var(--sw-red); }
.sw-fg-orange   { color: var(--sw-orange); }
.sw-fg-yellow   { color: var(--sw-yellow); }
.sw-fg-purple   { color: var(--sw-purple); }
.sw-fg-pink     { color: var(--sw-pink); }
.sw-fg-teal     { color: var(--sw-teal); }
.sw-fg-indigo   { color: var(--sw-indigo); }
.sw-fg-mint     { color: var(--sw-mint); }
.sw-fg-cyan     { color: var(--sw-cyan); }
.sw-fg-brown    { color: var(--sw-brown); }
.sw-fg-gray     { color: var(--sw-gray); }
.sw-fg-on-tint  { color: #FFFFFF; }

/* Surfaces */
.sw-bg-window               { background-color: var(--sw-window-bg); }
.sw-bg-content              { background-color: var(--sw-content-bg); }
.sw-bg-tertiary             { background-color: var(--sw-tertiary-bg); }
.sw-bg-grouped              { background-color: var(--sw-grouped-bg); }
.sw-bg-secondary-grouped    { background-color: var(--sw-secondary-grouped-bg); }
.sw-bg-tertiary-grouped     { background-color: var(--sw-tertiary-grouped-bg); }
.sw-bg-elevated             { background-color: var(--sw-elevated-bg); }
.sw-bg-fill-1               { background-color: var(--sw-fill-primary); }
.sw-bg-fill-2               { background-color: var(--sw-fill-secondary); }
.sw-bg-fill-3               { background-color: var(--sw-fill-tertiary); }
.sw-bg-fill-4               { background-color: var(--sw-fill-quaternary); }

/* Materials (vibrancy) */
.sw-material-regular {
  background: var(--sw-material-regular-bg);
  -webkit-backdrop-filter: var(--sw-material-regular-blur);
  backdrop-filter: var(--sw-material-regular-blur);
}
.sw-material-thick {
  background: var(--sw-material-thick-bg);
  -webkit-backdrop-filter: var(--sw-material-thick-blur);
  backdrop-filter: var(--sw-material-thick-blur);
}
.sw-material-thin {
  background: var(--sw-material-thin-bg);
  -webkit-backdrop-filter: var(--sw-material-thin-blur);
  backdrop-filter: var(--sw-material-thin-blur);
}
.sw-material-ultra-thin {
  background: var(--sw-material-ultra-thin-bg);
  -webkit-backdrop-filter: var(--sw-material-ultra-thin-blur);
  backdrop-filter: var(--sw-material-ultra-thin-blur);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Liquid Glass — iOS 26 (WWDC 2025)                           │
   ╰──────────────────────────────────────────────────────────────╯
   The new Liquid Glass material has THREE compositional layers:
     1. Highlight — light casting / movement (top inner edge)
     2. Shadow   — depth between fg and bg (outer drop shadow)
     3. Illumination — fluidity of the material (saturated blur)

   Per Apple HIG: glass is for the NAVIGATION layer that floats
   above content. Never apply to content lists/tables/media or
   stacked glass. Use for: nav bars, toolbars, tab bars, FABs,
   sheets, popovers, menus.

   Variants:
     .sw-glass            — regular (medium translucency, default)
     .sw-glass-clear      — high translucency for media-rich bg
     .sw-glass-prominent  — opaque tinted (primary action)

   Default shape is capsule (border-radius: 9999px). For
   rectangular surfaces (sheets/cards) use --sw-glass-radius. */

/* Refractive Liquid Glass — large surface for chrome (sheets, modals, FAB).
   Light back-blur for legibility behind text + lens refraction. */
.sw-glass {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(8px) saturate(180%) url(#sw-glass-refract);
          backdrop-filter: blur(8px) saturate(180%) url(#sw-glass-refract);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.20),
    0 6px 20px rgba(0, 0, 0, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.18);
  color: var(--sw-label);
  isolation: isolate;
}

/* Lighter glass for media-rich contexts */
.sw-glass-clear {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  -webkit-backdrop-filter: blur(4px) saturate(160%) url(#sw-glass-refract);
          backdrop-filter: blur(4px) saturate(160%) url(#sw-glass-refract);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.16),
    0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Prominent glass — translucent tinted (background partially shows through) */
.sw-glass-prominent {
  position: relative;
  background: rgba(var(--sw-blue-rgb), 0.30);
  -webkit-backdrop-filter: blur(6px) saturate(180%) url(#sw-glass-refract);
          backdrop-filter: blur(6px) saturate(180%) url(#sw-glass-refract);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.45),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.12),
    0 4px 14px rgba(var(--sw-blue-rgb), 0.25),
    0 1px 3px rgba(0, 0, 0, 0.18);
  color: #FFFFFF;
}

/* Light-mode glass */
:root[data-theme="light"] .sw-glass {
  background: rgba(255, 255, 255, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.80),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.06),
    0 6px 20px rgba(0, 0, 0, 0.10);
}
:root[data-theme="light"] .sw-glass-clear {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.70),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Browsers without backdrop-filter: url() support — fallback to plain blur. */
@supports not (backdrop-filter: url(#sw-glass-refract)) {
  .sw-glass,
  .sw-glass-clear {
    -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(110%);
            backdrop-filter: blur(20px) saturate(180%) brightness(110%);
  }
}

/* Interactive glass — adds press lensing + scale */
.sw-glass-interactive {
  cursor: pointer;
  transition:
    background-color 160ms var(--sw-ease-emphasis),
    box-shadow 160ms var(--sw-ease-emphasis),
    transform 100ms var(--sw-ease-standard);
}
.sw-glass-interactive:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 32%),
    rgba(255, 255, 255, 0.12);
}
.sw-glass-interactive:active {
  transform: scale(0.96);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 32%),
    rgba(255, 255, 255, 0.16);
}

/* Glass bar — refractive top nav / toolbar (glass3d-style 3D bevel). */
.sw-glass-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: brightness(1.10) saturate(180%) blur(2px) url(#sw-glass-refract);
          backdrop-filter: brightness(1.10) saturate(180%) blur(2px) url(#sw-glass-refract);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset  0  1px 0 rgba(255, 255, 255, 0.30),
    inset  0 -1px 0 rgba(0, 0, 0, 0.30),
    0 6px 22px rgba(0, 0, 0, 0.40);
  isolation: isolate;
}
:root[data-theme="light"] .sw-glass-bar {
  background: rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    inset  0  1px 0 rgba(255, 255, 255, 0.85),
    inset  0 -1px 0 rgba(0, 0, 0, 0.05),
    0 6px 22px rgba(0, 0, 0, 0.10);
}
@supports not (backdrop-filter: url(#sw-glass-refract)) {
  .sw-glass-bar {
    -webkit-backdrop-filter: blur(28px) saturate(180%);
            backdrop-filter: blur(28px) saturate(180%);
  }
}
:root[data-theme="light"] .sw-glass-bar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.10) 50%),
    rgba(255, 255, 255, 0.65);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 0 rgba(0, 0, 0, 0.04);
}

/* Floating glass bar — sits over content with pill radius and outer shadow */
.sw-glass-bar-floating {
  border-radius: 9999px;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 12px 36px rgba(0, 0, 0, 0.40),
    0 4px 12px rgba(0, 0, 0, 0.20);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.18);
}

/* Floating Action Button (FAB) — capsule glass over content */
.sw-fab {
  position: fixed;
  right: var(--sw-space-4);
  bottom: var(--sw-space-4);
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 36%),
    var(--sw-blue);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.40),
    0 12px 32px rgba(var(--sw-blue-rgb), 0.45),
    0 4px 12px rgba(0, 0, 0, 0.30);
  transition: transform 120ms var(--sw-ease-emphasis), box-shadow 200ms;
  z-index: 30;
}
.sw-fab:hover  { transform: scale(1.04); }
.sw-fab:active { transform: scale(0.96); }

/* GlassEffectContainer — clear translucent surface for grouped controls
   (glass-on-glass avoidance per Apple HIG). Body is mostly see-through. */
.sw-glass-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: url(#sw-glass-refract);
          backdrop-filter: url(#sw-glass-refract);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.15),
    0 1px 4px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .sw-glass-group {
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.50);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.70),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.06);
}
@supports not (backdrop-filter: url(#sw-glass-refract)) {
  .sw-glass-group {
    -webkit-backdrop-filter: blur(20px) saturate(180%);
            backdrop-filter: blur(20px) saturate(180%);
  }
}
.sw-glass-group > * {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Reduced transparency / contrast accessibility */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .sw-glass, .sw-glass-clear, .sw-glass-bar, .sw-glass-group {
    background: var(--sw-content-bg) !important;
    -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
  }
}

.sw-divider {
  height: 1px;
  background: var(--sw-separator);
  border: 0;
}
.sw-divider-vertical {
  width: 1px;
  background: var(--sw-separator);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  NavigationStack — large title + scroll-aware bar            │
   ╰──────────────────────────────────────────────────────────────╯
   iOS pattern: large title (34/700/-0.03em) appears at top of page,
   collapses into navbar on scroll. We provide static styles; scroll
   transition is left to JS if needed. */
.sw-nav-bar {
  display: flex;
  align-items: center;
  gap: var(--sw-space-2);
  height: 44px;
  padding: 0 var(--sw-space-4);
  background: var(--sw-material-thick-bg);
  -webkit-backdrop-filter: var(--sw-material-thick-blur);
  backdrop-filter: var(--sw-material-thick-blur);
  border-bottom: 0.5px solid var(--sw-separator);
  flex-shrink: 0;
}
.sw-nav-title {
  font-family: var(--sw-font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--sw-label);
  letter-spacing: -0.020em;
}
.sw-nav-leading,
.sw-nav-trailing {
  display: inline-flex;
  align-items: center;
  gap: var(--sw-space-2);
}
.sw-nav-trailing { margin-left: auto; }

.sw-page-large-title {
  display: block;
  font-family: var(--sw-font-display);
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: -0.030em;
  color: var(--sw-label);
  padding: 0 var(--sw-space-4);
}
.sw-page-subtitle {
  display: block;
  margin-top: 2px;
  padding: 0 var(--sw-space-4);
  font-family: var(--sw-font-text);
  font-size: 17px;
  font-weight: 400;
  color: var(--sw-secondary-label);
  letter-spacing: -0.020em;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Block (iOS section container)                               │
   ╰──────────────────────────────────────────────────────────────╯
   iOS pages stack "blocks" vertically with 35px between them.
   .sw-block        — flush-edge content (free-form section)
   .sw-block-strong — content with secondary-grouped fill
   .sw-block-inset  — strong + 16px side margin + 24px radius (iOS hallmark)
*/
.sw-block {
  padding: var(--sw-space-4);
  margin: 0;
}
.sw-block + .sw-block,
.sw-block + .sw-list,
.sw-list + .sw-block,
.sw-list + .sw-list {
  margin-top: var(--sw-space-8);    /* 35px */
}
.sw-block-strong {
  background: var(--sw-secondary-grouped-bg);
  padding: var(--sw-space-4);
}
.sw-block-inset {
  margin-left: var(--sw-space-4);
  margin-right: var(--sw-space-4);
  background: var(--sw-secondary-grouped-bg);
  border-radius: var(--sw-radius-inset);
  padding: var(--sw-space-4);
}
.sw-block-title {
  display: block;
  margin: 0 0 10px;
  padding: 0 var(--sw-space-4);
  font-family: var(--sw-font-text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.020em;
  color: var(--sw-label);
}
.sw-block-title-medium {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
.sw-block-title-large {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}
/* Section header (above grouped lists, secondary label, sentence case) */
.sw-section-header {
  display: block;
  padding: 24px var(--sw-space-4) 6px;
  font-family: var(--sw-font-text);
  font-size: 13px;
  font-weight: 400;
  color: var(--sw-secondary-label);
  letter-spacing: -0.008em;
  text-transform: none;
}
.sw-section-footer {
  display: block;
  padding: 6px var(--sw-space-4) 0;
  font-family: var(--sw-font-text);
  font-size: 13px;
  color: var(--sw-tertiary-label);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Lists (insetGrouped, plain, sidebar)                        │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
/* Inset grouped — iOS hallmark; rounded inset card with internal dividers */
.sw-list-inset {
  background: var(--sw-secondary-grouped-bg);
  border-radius: var(--sw-radius-inset);
  margin: 0 var(--sw-space-4);
  overflow: hidden;
}
/* Strong (filled background, full-width edges) */
.sw-list-strong {
  background: var(--sw-secondary-grouped-bg);
}
/* Plain — flush, no fill */
.sw-list-plain {
  background: transparent;
}

/* Row */
.sw-list-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sw-space-3);
  min-height: 44px;
  padding: 11px var(--sw-space-4);
  background: transparent;
  color: var(--sw-label);
  font-family: var(--sw-font-text);
  font-size: 17px;
  letter-spacing: -0.020em;
  cursor: default;
  text-decoration: none;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background-color 120ms var(--sw-ease-standard);
}
button.sw-list-row,
a.sw-list-row,
.sw-list-row[role="button"],
.sw-list-row.is-interactive {
  cursor: pointer;
}
button.sw-list-row:hover,
a.sw-list-row:hover,
.sw-list-row[role="button"]:hover,
.sw-list-row.is-interactive:hover {
  background: var(--sw-fill-quaternary);
}
button.sw-list-row:active,
a.sw-list-row:active,
.sw-list-row[role="button"]:active,
.sw-list-row.is-interactive:active {
  background: var(--sw-fill-tertiary);
}
.sw-list-row.is-selected {
  background: rgba(var(--sw-blue-rgb), 0.15);
  color: var(--sw-label);
}

/* Hairline divider, inset 16px on the leading side (iOS pattern) */
.sw-list-row + .sw-list-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--sw-space-4);
  right: 0;
  height: 0.5px;
  background: var(--sw-separator);
  pointer-events: none;
}
/* If a row has a leading icon, divider should start after it (60-72px) */
.sw-list-row.has-leading + .sw-list-row::before {
  left: calc(var(--sw-space-4) + 36px);
}

.sw-list-row-leading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
}
.sw-list-row-leading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  color: #FFFFFF;
}
.sw-list-row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-list-row-title {
  font-size: 17px;
  font-weight: 400;
  color: var(--sw-label);
  letter-spacing: -0.020em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-list-row-subtitle {
  font-size: 13px;
  color: var(--sw-secondary-label);
  letter-spacing: -0.008em;
}
.sw-list-row-trailing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--sw-secondary-label);
  font-size: 17px;
  letter-spacing: -0.020em;
}
.sw-list-row-trailing-secondary {
  color: var(--sw-secondary-label);
}
/* Disclosure chevron (›) */
.sw-list-row-chevron {
  width: 8px;
  height: 13px;
  margin-left: 2px;
  background: var(--sw-tertiary-label);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1 1l5 5.5L1 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1 1l5 5.5L1 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Sidebar list (sidebar-style — used in left rails) */
.sw-list-sidebar .sw-list-row {
  margin: 0 var(--sw-space-2);
  border-radius: 8px;
  min-height: 36px;
  padding: 8px var(--sw-space-3);
  font-size: 15px;
}
.sw-list-sidebar .sw-list-row + .sw-list-row::before { display: none; }
.sw-list-sidebar .sw-list-row:hover { background: var(--sw-fill-quaternary); }
.sw-list-sidebar .sw-list-row.is-selected {
  background: var(--sw-fill-secondary);
  color: var(--sw-label);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Buttons                                                     │
   ╰──────────────────────────────────────────────────────────────╯
   iOS button heights: small 28, regular 34, large 48, xl 56.
   Default radius 12 (large rounded) for prominent buttons. Plain
   buttons are blue text only. */
.sw-btn {
  --sw-btn-h: var(--sw-h-regular);
  --sw-btn-px: 16px;
  --sw-btn-radius: 12px;
  --sw-btn-font: 15px;
  --sw-btn-weight: 500;
  --sw-btn-bg: var(--sw-fill-tertiary);
  --sw-btn-fg: var(--sw-blue);
  --sw-btn-bg-hover: var(--sw-fill-secondary);
  --sw-btn-bg-active: var(--sw-fill-primary);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--sw-btn-h);
  min-height: var(--sw-btn-h);
  padding: 0 var(--sw-btn-px);
  border: 0;
  border-radius: var(--sw-btn-radius);
  font-family: var(--sw-font-text);
  font-size: var(--sw-btn-font);
  font-weight: var(--sw-btn-weight);
  letter-spacing: -0.014em;
  background: var(--sw-btn-bg);
  color: var(--sw-btn-fg);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition:
    background-color 120ms var(--sw-ease-standard),
    color           120ms var(--sw-ease-standard),
    transform        80ms var(--sw-ease-standard),
    opacity         120ms var(--sw-ease-standard);
}
.sw-btn:hover  { background: var(--sw-btn-bg-hover); }
.sw-btn:active { background: var(--sw-btn-bg-active); transform: scale(0.97); }
.sw-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--sw-keyboard-focus-ring);
}
.sw-btn:disabled,
.sw-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sizes */
.sw-btn-small   { --sw-btn-h: var(--sw-h-small);   --sw-btn-px: 12px; --sw-btn-font: 14px; --sw-btn-radius: 8px; }
.sw-btn-regular { --sw-btn-h: var(--sw-h-regular); --sw-btn-px: 16px; --sw-btn-font: 15px; --sw-btn-radius: 12px; }
.sw-btn-large   { --sw-btn-h: var(--sw-h-large);   --sw-btn-px: 20px; --sw-btn-font: 17px; --sw-btn-radius: 14px; --sw-btn-weight: 600; }
.sw-btn-xl      { --sw-btn-h: var(--sw-h-xl);      --sw-btn-px: 24px; --sw-btn-font: 17px; --sw-btn-radius: 16px; --sw-btn-weight: 600; }
.sw-btn-mini    { --sw-btn-h: 22px;                --sw-btn-px: 8px;  --sw-btn-font: 12px; --sw-btn-radius: 6px; }

/* Roles */
.sw-btn-prominent {
  --sw-btn-bg: var(--sw-blue);
  --sw-btn-fg: #FFFFFF;
  --sw-btn-bg-hover: color-mix(in srgb, var(--sw-blue) 88%, white 12%);
  --sw-btn-bg-active: color-mix(in srgb, var(--sw-blue) 80%, black 20%);
  --sw-btn-weight: 600;
}
.sw-btn-tonal {
  --sw-btn-bg: rgba(var(--sw-blue-rgb), 0.15);
  --sw-btn-fg: var(--sw-blue);
  --sw-btn-bg-hover: rgba(var(--sw-blue-rgb), 0.22);
  --sw-btn-bg-active: rgba(var(--sw-blue-rgb), 0.30);
  --sw-btn-weight: 500;
}
.sw-btn-bordered {
  --sw-btn-bg: var(--sw-fill-tertiary);
  --sw-btn-fg: var(--sw-label);
  --sw-btn-bg-hover: var(--sw-fill-secondary);
  --sw-btn-bg-active: var(--sw-fill-primary);
}
.sw-btn-outline {
  --sw-btn-bg: transparent;
  --sw-btn-fg: var(--sw-blue);
  --sw-btn-bg-hover: rgba(var(--sw-blue-rgb), 0.10);
  --sw-btn-bg-active: rgba(var(--sw-blue-rgb), 0.18);
  border: 1.5px solid var(--sw-blue);
}
.sw-btn-plain,
.sw-btn-borderless {
  --sw-btn-bg: transparent;
  --sw-btn-fg: var(--sw-blue);
  --sw-btn-bg-hover: var(--sw-fill-quaternary);
  --sw-btn-bg-active: var(--sw-fill-tertiary);
  --sw-btn-weight: 400;
}
.sw-btn-clear {
  --sw-btn-bg: transparent;
  --sw-btn-fg: var(--sw-label);
  --sw-btn-bg-hover: var(--sw-fill-quaternary);
  --sw-btn-bg-active: var(--sw-fill-tertiary);
  --sw-btn-weight: 400;
}
.sw-btn-destructive {
  --sw-btn-bg: var(--sw-red);
  --sw-btn-fg: #FFFFFF;
  --sw-btn-bg-hover: color-mix(in srgb, var(--sw-red) 88%, white 12%);
  --sw-btn-bg-active: color-mix(in srgb, var(--sw-red) 80%, black 20%);
  --sw-btn-weight: 600;
}
.sw-btn-destructive-tonal {
  --sw-btn-bg: rgba(var(--sw-red-rgb), 0.15);
  --sw-btn-fg: var(--sw-red);
  --sw-btn-bg-hover: rgba(var(--sw-red-rgb), 0.22);
  --sw-btn-bg-active: rgba(var(--sw-red-rgb), 0.30);
  --sw-btn-weight: 500;
}
.sw-btn-destructive-text {
  --sw-btn-bg: transparent;
  --sw-btn-fg: var(--sw-red);
  --sw-btn-bg-hover: rgba(var(--sw-red-rgb), 0.10);
  --sw-btn-bg-active: rgba(var(--sw-red-rgb), 0.18);
}

/* ── Liquid Glass button (CLEAR — almost no body, no blur, real see-through)
   Real glass3d.dev: clear body, minimal/no blur, visible refraction at edges,
   thin bright rim. You can read text/UI through the button clearly. ── */
.sw-btn-glass {
  --sw-btn-radius: 9999px;
  --sw-btn-bg: transparent;
  --sw-btn-fg: var(--sw-label);
  --sw-btn-bg-hover: transparent;
  --sw-btn-bg-active: transparent;
  --sw-btn-weight: 500;
  /* Almost completely clear */
  background: rgba(255, 255, 255, 0.02);
  /* Refraction-only — the lens displacement bends background, NO blur fog */
  -webkit-backdrop-filter: url(#sw-glass-refract);
          backdrop-filter: url(#sw-glass-refract);
  /* Thin rim — the only place light "catches" */
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    /* Hairline top edge highlight (the rim of the glass) */
    inset 0 0.5px 0 rgba(255, 255, 255, 0.35),
    /* Hairline bottom darker edge */
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.15),
    /* Soft drop shadow — the only depth */
    0 1px 4px rgba(0, 0, 0, 0.18);
  transition:
    transform 100ms var(--sw-ease-standard),
    background-color 160ms var(--sw-ease-emphasis),
    border-color 160ms var(--sw-ease-emphasis);
}
.sw-btn-glass:hover  {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
}
.sw-btn-glass:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.01);
}
:root[data-theme="light"] .sw-btn-glass {
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.50);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.70),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.06);
}
@supports not (backdrop-filter: url(#sw-glass-refract)) {
  .sw-btn-glass {
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
  }
}

/* ── Liquid Glass — prominent (CLEAR tinted glass — body is mostly see-through
   with a light color cast, not a solid fill). ── */
.sw-btn-glass-prominent {
  --sw-btn-radius: 9999px;
  --sw-btn-bg: transparent;
  --sw-btn-fg: #FFFFFF;
  --sw-btn-bg-hover: transparent;
  --sw-btn-bg-active: transparent;
  --sw-btn-weight: 600;
  /* Light tint — 25% color cast, background still very visible */
  background: rgba(var(--sw-blue-rgb), 0.28);
  -webkit-backdrop-filter: url(#sw-glass-refract);
          backdrop-filter: url(#sw-glass-refract);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.45),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.18);
  transition:
    transform 100ms var(--sw-ease-standard),
    background-color 160ms var(--sw-ease-emphasis),
    border-color 160ms var(--sw-ease-emphasis);
}
.sw-btn-glass-prominent:hover {
  background: rgba(var(--sw-blue-rgb), 0.40);
  border-color: rgba(255, 255, 255, 0.32);
}
.sw-btn-glass-prominent:active {
  transform: scale(0.97);
  background: rgba(var(--sw-blue-rgb), 0.22);
}

/* Tint variants — same translucent treatment, different tint color */
.sw-btn-glass-prominent.is-green   { background: rgba(var(--sw-green-rgb), 0.28); }
.sw-btn-glass-prominent.is-green:hover  { background: rgba(var(--sw-green-rgb), 0.40); }
.sw-btn-glass-prominent.is-red    { background: rgba(var(--sw-red-rgb), 0.28); }
.sw-btn-glass-prominent.is-red:hover    { background: rgba(var(--sw-red-rgb), 0.40); }
.sw-btn-glass-prominent.is-orange { background: rgba(var(--sw-orange-rgb), 0.28); }
.sw-btn-glass-prominent.is-orange:hover { background: rgba(var(--sw-orange-rgb), 0.40); }
.sw-btn-glass-prominent.is-purple { background: rgba(var(--sw-purple-rgb), 0.28); }
.sw-btn-glass-prominent.is-purple:hover { background: rgba(var(--sw-purple-rgb), 0.40); }
.sw-btn-glass-prominent.is-pink   { background: rgba(var(--sw-pink-rgb), 0.28); }
.sw-btn-glass-prominent.is-pink:hover   { background: rgba(var(--sw-pink-rgb), 0.40); }
.sw-btn-glass-prominent.is-yellow { background: rgba(var(--sw-yellow-rgb), 0.28); }
.sw-btn-glass-prominent.is-yellow:hover { background: rgba(var(--sw-yellow-rgb), 0.40); }
.sw-btn-glass-prominent.is-blue   { background: rgba(var(--sw-blue-rgb), 0.28); }
.sw-btn-glass-prominent.is-blue:hover   { background: rgba(var(--sw-blue-rgb), 0.40); }

/* When inside a `.sw-glass-group`, glass buttons drop their own backdrop
   to avoid stacked glass-on-glass (per Apple HIG). */
.sw-glass-group .sw-btn-glass,
.sw-glass-group .sw-btn-glass-prominent {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
          backdrop-filter: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.sw-glass-group .sw-btn-glass:hover,
.sw-glass-group .sw-btn-glass.is-selected {
  background: rgba(255, 255, 255, 0.14) !important;
}
.sw-glass-group .sw-btn-glass-prominent {
  background: var(--sw-blue) !important;
  color: #FFFFFF;
}

/* Square / icon-only */
.sw-btn-icon {
  --sw-btn-px: 0;
  width: var(--sw-btn-h);
  padding: 0;
  border-radius: var(--sw-btn-radius);
}
.sw-btn-pill { border-radius: var(--sw-radius-pill); }

/* ╭──────────────────────────────────────────────────────────────╮
   │  Chat bubbles — Liquid Glass with curved light refraction    │
   ╰──────────────────────────────────────────────────────────────╯
   The "curved light" effect is faked with a layered shadow stack:
     1. inset top-left highlight  (where light enters the glass thickness)
     2. inset bottom-right shadow (where light exits, attenuated)
     3. soft outer drop shadow    (glass body lifts off the surface)
   Combined with backdrop-filter saturate+blur and a hairline border,
   the bubble reads like a piece of clear glass — see-through with a
   subtle tint, light-catching rim. Same vocabulary as iOS 26 widgets. */
.sw-chat-bubble {
  position: relative;
  border-radius: 18px;
  padding: 12px 16px;
  -webkit-backdrop-filter: blur(18px) saturate(180%);
          backdrop-filter: blur(18px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.30),    /* top rim highlight */
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),         /* bottom rim shadow */
    inset 1px 0 0 rgba(255, 255, 255, 0.08),      /* left rim refraction */
    0 1px 4px rgba(0, 0, 0, 0.12),                /* soft drop shadow */
    0 8px 24px -8px rgba(0, 0, 0, 0.10);          /* depth at distance */
  transition: transform 200ms var(--sw-ease-emphasis),
              box-shadow 200ms var(--sw-ease-emphasis);
}
:root[data-theme="light"] .sw-chat-bubble {
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    0 1px 4px rgba(0, 0, 0, 0.04),
    0 8px 24px -8px rgba(0, 0, 0, 0.04);
}

/* User bubble: blue-tinted glass — body stays mostly translucent so
   the wallpaper/background reads through, but the tint says "from me". */
.sw-chat-bubble-user {
  background: rgba(var(--sw-blue-rgb), 0.22);
  color: var(--sw-blue);
  border-bottom-right-radius: 6px;     /* tail nub */
}
:root[data-theme="light"] .sw-chat-bubble-user {
  background: rgba(var(--sw-blue-rgb), 0.16);
}

/* Assistant bubble: untinted clear glass with very faint white wash. */
.sw-chat-bubble-ai {
  background: rgba(255, 255, 255, 0.04);
  color: var(--sw-label);
  border-bottom-left-radius: 6px;      /* tail nub */
}
:root[data-theme="light"] .sw-chat-bubble-ai {
  background: rgba(255, 255, 255, 0.50);
}

/* Reduced transparency: drop the blur, keep the bubble visible. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .sw-chat-bubble {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .sw-chat-bubble-ai   { background: var(--sw-content-bg) !important; }
  .sw-chat-bubble-user { background: rgba(var(--sw-blue-rgb), 0.18) !important; }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Chat step / status cards (SSE-rendered)                     │
   ╰──────────────────────────────────────────────────────────────╯
   Same Liquid Glass vocabulary as chat bubbles, but rectangular —
   used for AI step cards (thinking + action + log + metrics) and
   one-liner status cards (done, error, cancelled, warning, queued). */
.sw-chat-card {
  position: relative;
  border-radius: 16px;
  -webkit-backdrop-filter: blur(18px) saturate(180%);
          backdrop-filter: blur(18px) saturate(180%);
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.28),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.12),
    0 8px 24px -8px rgba(0, 0, 0, 0.14);
  color: var(--sw-label);
}
:root[data-theme="light"] .sw-chat-card {
  background: rgba(255, 255, 255, 0.55);
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    0 1px 4px rgba(0, 0, 0, 0.06),
    0 8px 24px -8px rgba(0, 0, 0, 0.06);
}

/* Tinted variants — same refraction shape, semantic colour cast.
   Body still translucent; user can read scroll context behind. */
.sw-chat-card-success { background: rgba(var(--sw-green-rgb),  0.14); }
.sw-chat-card-error   { background: rgba(var(--sw-red-rgb),    0.14); }
.sw-chat-card-warning { background: rgba(var(--sw-orange-rgb), 0.14); }
.sw-chat-card-info    { background: rgba(var(--sw-blue-rgb),   0.12); }
:root[data-theme="light"] .sw-chat-card-success { background: rgba(var(--sw-green-rgb),  0.10); }
:root[data-theme="light"] .sw-chat-card-error   { background: rgba(var(--sw-red-rgb),    0.10); }
:root[data-theme="light"] .sw-chat-card-warning { background: rgba(var(--sw-orange-rgb), 0.10); }
:root[data-theme="light"] .sw-chat-card-info    { background: rgba(var(--sw-blue-rgb),   0.08); }

/* Header strip inside step card: tiny status pill, optional action button. */
.sw-chat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  gap: 8px;
}
.sw-chat-card-body {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sw-chat-card-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sw-chat-card-section + .sw-chat-card-section {
  padding-top: 10px;
  border-top: 0.5px solid var(--sw-separator);
}
.sw-chat-card-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sw-fg-secondary);
  letter-spacing: 0.01em;
}
.sw-chat-card-section-title .ph,
.sw-chat-card-section-title .ph-fill {
  font-size: 14px;
  color: var(--sw-fg-tertiary);
}

/* Step badge — small caps pill in the header */
.sw-step-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--sw-blue-rgb), 0.20);
  color: var(--sw-blue);
  border: 0.5px solid rgba(var(--sw-blue-rgb), 0.30);
}

/* Inline code block inside a card section (action JSON). */
.sw-chat-card pre.sw-chat-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--sw-fg-secondary);
  background: rgba(0, 0, 0, 0.18);
  border: 0.5px solid var(--sw-separator);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0;
  white-space: pre-wrap;
  overflow-x: auto;
}
:root[data-theme="light"] .sw-chat-card pre.sw-chat-code {
  background: rgba(0, 0, 0, 0.04);
  color: var(--sw-fg);
}

/* Mini "stop" button used inside running step header. */
.sw-step-stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(var(--sw-red-rgb), 0.18);
  color: var(--sw-red);
  border: 0.5px solid rgba(var(--sw-red-rgb), 0.30);
  transition: background 140ms var(--sw-ease-emphasis),
              transform 100ms var(--sw-ease-standard);
}
.sw-step-stop-btn:hover  { background: rgba(var(--sw-red-rgb), 0.28); }
.sw-step-stop-btn:active { transform: scale(0.96); }
.sw-step-stop-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Prompt input bar — fully Liquid Glass                       │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-input-bar {
  position: relative;
  border-radius: 22px;
  padding: 0;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.32),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.16),
    0 8px 24px -6px rgba(0, 0, 0, 0.20);
  transition: border-color 200ms var(--sw-ease-emphasis),
              box-shadow 200ms var(--sw-ease-emphasis);
}
:root[data-theme="light"] .sw-input-bar {
  background: rgba(255, 255, 255, 0.65);
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    0 1px 4px rgba(0, 0, 0, 0.06),
    0 8px 24px -6px rgba(0, 0, 0, 0.08);
}
.sw-input-bar:focus-within {
  border-color: rgba(var(--sw-blue-rgb), 0.40);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.40),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    inset 1px 0 0 rgba(255, 255, 255, 0.10),
    0 0 0 2px rgba(var(--sw-blue-rgb), 0.18),
    0 8px 28px -6px rgba(0, 0, 0, 0.24);
}
.sw-input-bar-inner {
  display: flex;
  align-items: end;
  gap: 4px;
  padding: 8px 8px 8px 6px;
}
.sw-input-bar textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--sw-label);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  overflow-y: hidden;
  min-height: 26px;
  max-height: 120px;
  padding: 6px 4px;
}
.sw-input-bar textarea::placeholder {
  color: var(--sw-fg-tertiary);
}
.sw-input-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--sw-fg-tertiary);
  cursor: pointer;
  transition: color 160ms var(--sw-ease-emphasis),
              background 160ms var(--sw-ease-emphasis),
              transform 120ms var(--sw-ease-standard);
  flex-shrink: 0;
  font-size: 18px;
}
.sw-input-btn:hover {
  color: var(--sw-label);
  background: rgba(255, 255, 255, 0.06);
}
:root[data-theme="light"] .sw-input-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
.sw-input-btn:active { transform: scale(0.92); }
.sw-input-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.sw-input-btn:disabled:hover {
  background: transparent;
  color: var(--sw-fg-tertiary);
}

/* New-chat button (left side) — softly emphasized to read as a primary
   action when the textarea is empty. */
.sw-input-btn-new {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sw-fg-secondary);
}
:root[data-theme="light"] .sw-input-btn-new {
  background: rgba(0, 0, 0, 0.04);
}
.sw-input-btn-new:hover {
  background: rgba(255, 255, 255, 0.10);
  transform: rotate(90deg) scale(1.05);
}
.sw-input-btn-new:active { transform: rotate(90deg) scale(0.92); }

/* Send button — Liquid Glass capsule, blue tint when text is ready. */
.sw-input-btn-send {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--sw-fg-tertiary);
}
:root[data-theme="light"] .sw-input-btn-send {
  background: rgba(0, 0, 0, 0.04);
}
.sw-input-btn-send.is-active {
  background: rgba(var(--sw-blue-rgb), 0.85);
  color: #fff;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.45),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    0 1px 4px rgba(0, 0, 0, 0.18);
}
.sw-input-btn-send.is-active:hover {
  background: rgba(var(--sw-blue-rgb), 1.0);
  transform: scale(1.06);
}
.sw-input-btn-send.is-active:active { transform: scale(0.92); }

/* Voice button "listening" pulse */
.sw-input-btn-voice.is-listening {
  color: var(--sw-red);
  background: rgba(var(--sw-red-rgb), 0.14);
  animation: sw-input-listen-pulse 1.4s var(--sw-ease-emphasis) infinite;
}
@keyframes sw-input-listen-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--sw-red-rgb), 0.35); }
  50%      { box-shadow: 0 0 0 8px rgba(var(--sw-red-rgb), 0.00); }
}
@media (prefers-reduced-motion: reduce) {
  .sw-input-btn-voice.is-listening { animation: none; }
}

/* (sw-dialog-* CSS lives further down — see "Liquid Glass alert/confirm
   modal system" section. The earlier draft here was a duplicate.) */

/* ╭──────────────────────────────────────────────────────────────╮
   │  Apple Glass alert / confirm dialog (sw-dialog.js)           │
   ╰──────────────────────────────────────────────────────────────╯
   Single-screen modal that replaces native window.alert/confirm.
   Backdrop fades in, card scales up with iOS spring easing. */
.sw-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}
.sw-dialog-overlay.is-open { pointer-events: auto; }

.sw-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.sw-dialog-overlay.is-open .sw-dialog-backdrop { opacity: 1; }
.sw-dialog-overlay.is-closing .sw-dialog-backdrop {
  opacity: 0;
  transition-duration: 180ms;
}
:root[data-theme="light"] .sw-dialog-backdrop {
  background: rgba(0, 0, 0, 0.18);
}

.sw-dialog-card {
  position: relative;
  max-width: 380px;
  min-width: 280px;
  width: 100%;
  border-radius: 18px;
  padding: 22px 22px 18px;
  background: rgba(28, 28, 30, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
          backdrop-filter: blur(40px) saturate(180%);
  color: var(--sw-label);
  text-align: center;
  outline: none;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.32),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    0 12px 36px -6px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.30);
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition:
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sw-dialog-overlay.is-open .sw-dialog-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.sw-dialog-overlay.is-closing .sw-dialog-card {
  transform: scale(0.96) translateY(2px);
  opacity: 0;
  transition-duration: 180ms;
}
:root[data-theme="light"] .sw-dialog-card {
  background: rgba(248, 248, 248, 0.86);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    0 12px 36px -6px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Optional kind icon at the top — soft tinted circle. */
.sw-dialog-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sw-fg-secondary);
}
.sw-dialog-kind-info     .sw-dialog-icon { background: rgba(var(--sw-blue-rgb),   0.18); color: var(--sw-blue);   }
.sw-dialog-kind-success  .sw-dialog-icon { background: rgba(var(--sw-green-rgb),  0.18); color: var(--sw-green);  }
.sw-dialog-kind-warning  .sw-dialog-icon { background: rgba(var(--sw-orange-rgb), 0.18); color: var(--sw-orange); }
.sw-dialog-kind-error    .sw-dialog-icon { background: rgba(var(--sw-red-rgb),    0.18); color: var(--sw-red);    }
.sw-dialog-kind-question .sw-dialog-icon { background: rgba(var(--sw-blue-rgb),   0.16); color: var(--sw-blue);   }
.sw-dialog-kind-prompt   .sw-dialog-icon { background: rgba(var(--sw-blue-rgb),   0.16); color: var(--sw-blue);   }

/* Prompt input field — Liquid Glass-friendly inset, focus rim matches the
   primary action button's tint. */
.sw-dialog-input {
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--sw-label);
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid var(--sw-separator);
  outline: none;
  resize: vertical;
  transition:
    border-color 150ms var(--sw-ease-emphasis),
    background  150ms var(--sw-ease-emphasis),
    box-shadow  150ms var(--sw-ease-emphasis);
}
:root[data-theme="light"] .sw-dialog-input {
  background: rgba(0, 0, 0, 0.03);
}
.sw-dialog-input::placeholder { color: var(--sw-fg-tertiary); }
.sw-dialog-input:focus {
  border-color: rgba(var(--sw-blue-rgb), 0.55);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(var(--sw-blue-rgb), 0.18);
}
:root[data-theme="light"] .sw-dialog-input:focus {
  background: rgba(0, 0, 0, 0.04);
}

.sw-dialog-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  line-height: 1.25;
}
.sw-dialog-message {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--sw-fg-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 auto;
  max-width: 320px;
}

.sw-dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: stretch;
}
.sw-dialog-btn {
  flex: 1 1 0;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid transparent;
  transition: background 160ms var(--sw-ease-emphasis),
              transform 100ms var(--sw-ease-standard),
              border-color 160ms var(--sw-ease-emphasis);
  font-family: inherit;
  letter-spacing: -0.01em;
}
.sw-dialog-btn:focus-visible {
  outline: 2px solid rgba(var(--sw-blue-rgb), 0.45);
  outline-offset: 2px;
}
.sw-dialog-btn:active { transform: scale(0.97); }

.sw-dialog-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sw-label);
  border-color: rgba(255, 255, 255, 0.10);
}
.sw-dialog-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}
:root[data-theme="light"] .sw-dialog-btn-cancel {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .sw-dialog-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.08);
}

.sw-dialog-btn-ok.is-primary {
  background: rgba(var(--sw-blue-rgb), 0.92);
  color: #fff;
  font-weight: 600;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.36),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(var(--sw-blue-rgb), 0.30);
}
.sw-dialog-btn-ok.is-primary:hover {
  background: rgba(var(--sw-blue-rgb), 1);
}
.sw-dialog-btn-ok.is-destructive {
  background: rgba(var(--sw-red-rgb), 0.92);
  color: #fff;
  font-weight: 600;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.36),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(var(--sw-red-rgb), 0.30);
}
.sw-dialog-btn-ok.is-destructive:hover {
  background: rgba(var(--sw-red-rgb), 1);
}

@media (prefers-reduced-motion: reduce) {
  .sw-dialog-card,
  .sw-dialog-backdrop {
    transition: none !important;
  }
  .sw-dialog-overlay.is-open .sw-dialog-card {
    transform: none;
  }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Phone-picker modal (extends sw-dialog-*)                    │
   ╰──────────────────────────────────────────────────────────────╯
   Wider Liquid Glass card with a list-style body — search field,
   group filter pills, scrollable phone rows, and a footer with
   refresh + "New phone". Reuses sw-dialog-overlay/backdrop/card so
   the entrance animation, backdrop blur, and ESC handling all match
   swAlert/swConfirm/swPrompt. */
.sw-phone-picker-card {
  max-width: 480px;
  min-width: 320px;
  width: 100%;
  text-align: left;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  max-height: min(640px, calc(100vh - 64px));
}

.sw-phone-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sw-phone-picker-close {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sw-fg-secondary);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 160ms var(--sw-ease-emphasis),
              color 160ms var(--sw-ease-emphasis),
              transform 100ms var(--sw-ease-standard);
}
.sw-phone-picker-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--sw-label);
}
.sw-phone-picker-close:active { transform: scale(0.92); }
:root[data-theme="light"] .sw-phone-picker-close {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .sw-phone-picker-close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.sw-phone-picker-groups {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 4px;
  margin-top: 4px;
}
.sw-phone-picker-groups::-webkit-scrollbar { height: 4px; }
.sw-phone-picker-groups::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.sw-phone-picker-list {
  margin-top: 10px;
  margin-left: -6px;
  margin-right: -6px;
  padding: 4px 6px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 120px;
  max-height: 360px;
  border-top: 0.5px solid var(--sw-separator);
  border-bottom: 0.5px solid var(--sw-separator);
}

.sw-phone-picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
}

.sw-phone-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  margin-top: 4px;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Workflow editor modal (extends sw-dialog-* / sw-phone-…)    │
   ╰──────────────────────────────────────────────────────────────╯
   Same Liquid Glass card as swAlert / Select-a-phone, but wider
   and tall enough for an inline form: name → platform/tags → mode
   toggle → scrollable step list. Reuses the dialog overlay so the
   entrance spring, backdrop blur and ESC handling are identical. */
.sw-wf-edit-card {
  max-width: 640px;
  min-width: 320px;
  width: 100%;
  text-align: left;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100vh - 64px));
}

.sw-wf-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sw-wf-edit-header-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  background: rgba(var(--sw-pink-rgb), 0.18);
  color: var(--sw-pink, #ff375f);
}

.sw-wf-edit-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--sw-label);
}
.sw-wf-edit-subtitle {
  font-size: 12px;
  color: var(--sw-fg-tertiary);
  margin-top: 2px;
}

/* Body — same border-top/bottom as sw-phone-picker-list so the
   header and footer feel like they're floating above a recessed
   form region. Internal scrolling lives here. */
.sw-wf-edit-body {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 12px -4px 0;
  padding: 12px 4px 4px;
  border-top: 0.5px solid var(--sw-separator);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.sw-wf-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sw-fg-tertiary);
}

.sw-wf-edit-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Inline platform-pill row that wraps; capsule glass to match the
   existing tag chips on the cards. */
.sw-wf-platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sw-wf-platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sw-secondary-label);
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 140ms var(--sw-ease-emphasis),
              color 140ms var(--sw-ease-emphasis),
              border-color 140ms var(--sw-ease-emphasis);
}
.sw-wf-platform-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--sw-label);
}
.sw-wf-platform-pill.is-active {
  background: rgba(var(--sw-blue-rgb), 0.20);
  border-color: rgba(var(--sw-blue-rgb), 0.40);
  color: rgb(var(--sw-blue-rgb));
}
:root[data-theme="light"] .sw-wf-platform-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .sw-wf-platform-pill:hover {
  background: rgba(0, 0, 0, 0.07);
}

/* Per-step row — compact, glass tile, with collapsible options
   (pause + timeout) under a ⋮ toggle so the list stays scannable. */
.sw-wf-step-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 8px 8px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  transition: background 140ms ease, border-color 140ms ease;
}
.sw-wf-step-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}
.sw-wf-step-row.is-selected {
  background: rgba(var(--sw-blue-rgb), 0.10);
  border-color: rgba(var(--sw-blue-rgb), 0.32);
}
:root[data-theme="light"] .sw-wf-step-row {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.05);
}
:root[data-theme="light"] .sw-wf-step-row:hover {
  background: rgba(0, 0, 0, 0.045);
}

.sw-wf-step-row-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.sw-wf-step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  font-feature-settings: "tnum";
  color: var(--sw-fg-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  margin-top: 6px;
}
:root[data-theme="light"] .sw-wf-step-num {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.05);
}

.sw-wf-step-textarea {
  flex: 1;
  min-height: 34px;
  max-height: 200px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--sw-label);
  font-size: 13px;
  line-height: 1.45;
  font-family: inherit;
  resize: none;
  padding: 6px 4px;
  letter-spacing: -0.005em;
}
.sw-wf-step-textarea::placeholder { color: var(--sw-fg-tertiary); }

.sw-wf-step-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--sw-fg-tertiary);
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 4px;
  transition: background 140ms ease, color 140ms ease, transform 100ms var(--sw-ease-standard);
}
.sw-wf-step-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sw-label);
}
.sw-wf-step-icon-btn:active { transform: scale(0.92); }
.sw-wf-step-icon-btn.is-open {
  background: rgba(255, 255, 255, 0.10);
  color: var(--sw-label);
}
.sw-wf-step-icon-btn.is-danger:hover {
  background: rgba(var(--sw-red-rgb), 0.14);
  color: var(--sw-red);
}
:root[data-theme="light"] .sw-wf-step-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sw-wf-step-checkbox {
  margin-top: 8px;
  flex-shrink: 0;
  accent-color: var(--sw-blue);
}

/* Slide-down options drawer per step (pause + timeout). Uses
   max-height transition so it animates without measuring. */
.sw-wf-step-options {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 4px 0 30px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 220ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 160ms ease,
              padding-top 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sw-wf-step-row.is-expanded .sw-wf-step-options {
  max-height: 60px;
  opacity: 1;
  padding-top: 6px;
}
.sw-wf-step-options-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--sw-fg-tertiary);
  cursor: pointer;
}
.sw-wf-step-options-label .sw-toggle {
  transform: scale(0.65);
  transform-origin: left center;
}

/* "Add step" dashed button — sits at the bottom of the list. */
.sw-wf-add-step {
  width: 100%;
  padding: 9px 0;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: transparent;
  color: var(--sw-fg-tertiary);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.sw-wf-add-step:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--sw-label);
}
:root[data-theme="light"] .sw-wf-add-step {
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .sw-wf-add-step:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.20);
}

/* Footer — alert-style: left meta, right [Cancel] [Save] using
   sw-dialog-btn so the buttons render exactly like swConfirm. */
.sw-wf-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 0.5px solid var(--sw-separator);
}
.sw-wf-edit-footer-actions {
  display: flex;
  gap: 8px;
}
.sw-wf-edit-footer .sw-dialog-btn {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 34px;
  padding: 7px 16px;
  font-size: 13px;
}
.sw-wf-edit-footer .sw-dialog-btn-destructive {
  background: transparent;
  color: var(--sw-red);
  border: 0;
  min-width: 0;
  padding: 4px 10px;
  font-weight: 500;
}
.sw-wf-edit-footer .sw-dialog-btn-destructive:hover {
  background: rgba(var(--sw-red-rgb), 0.12);
}

/* Variable autocomplete dropdown — anchored under the focused step. */
.sw-wf-var-popover {
  position: absolute;
  z-index: 60;
  margin-top: 4px;
  width: 240px;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(28, 28, 30, 0.92);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  -webkit-backdrop-filter: blur(36px) saturate(180%);
          backdrop-filter: blur(36px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.22),
    0 12px 36px -8px rgba(0, 0, 0, 0.55);
  padding: 4px;
}
:root[data-theme="light"] .sw-wf-var-popover {
  background: rgba(248, 248, 248, 0.95);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    0 12px 36px -8px rgba(0, 0, 0, 0.18);
}
.sw-wf-var-popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--sw-secondary-label);
  border-radius: 7px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--sw-mono, ui-monospace, "SF Mono", Menlo, monospace);
}
.sw-wf-var-popover-item:hover,
.sw-wf-var-popover-item.is-selected {
  background: rgba(var(--sw-blue-rgb), 0.16);
  color: rgb(var(--sw-blue-rgb));
}

/* Tag chip in the editor — uses the same capsule language as the
   page-level sw-wf-tag but accepts a remove (×) button. */
.sw-wf-edit-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  color: var(--sw-secondary-label);
  font-size: 11.5px;
  line-height: 16px;
  font-weight: 500;
}
.sw-wf-edit-tag button {
  width: 14px; height: 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--sw-fg-tertiary);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}
.sw-wf-edit-tag button:hover {
  background: rgba(255, 255, 255, 0.10);
  color: var(--sw-label);
}
:root[data-theme="light"] .sw-wf-edit-tag {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.05);
}
:root[data-theme="light"] .sw-wf-edit-tag button:hover {
  background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 520px) {
  .sw-wf-edit-card {
    max-height: calc(100vh - 24px);
    border-radius: 14px;
    padding: 14px 14px 12px;
  }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Liquid Glass checkbox                                       │
   ╰──────────────────────────────────────────────────────────────╯
   Replaces the native browser checkbox with an Apple-style square
   that uses the same rim refraction as buttons + dialogs. Applied
   automatically to every `<input type="checkbox">` so we don't have
   to thread a class through every template. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.14),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
  position: relative;
  transition:
    background 160ms var(--sw-ease-emphasis),
    border-color 160ms var(--sw-ease-emphasis),
    box-shadow 160ms var(--sw-ease-emphasis),
    transform 100ms var(--sw-ease-standard);
  vertical-align: middle;
}
input[type="checkbox"]:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.26);
}
input[type="checkbox"]:active:not(:disabled) { transform: scale(0.92); }
input[type="checkbox"]:checked {
  background: rgba(var(--sw-blue-rgb), 0.92);
  border-color: rgba(var(--sw-blue-rgb), 0.95);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.36),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(var(--sw-blue-rgb), 0.30);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 47%;
  width: 4.5px;
  height: 8px;
  border-right: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: translate(-50%, -55%) rotate(45deg);
  filter: drop-shadow(0 0.5px 0 rgba(0, 0, 0, 0.20));
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(var(--sw-blue-rgb), 0.45);
  outline-offset: 2px;
}
input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
:root[data-theme="light"] input[type="checkbox"] {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.14);
}
:root[data-theme="light"] input[type="checkbox"]:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.07);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Phone Farm islands (multi-view top + bottom toolbars)       │
   ╰──────────────────────────────────────────────────────────────╯
   iOS 26 / macOS Tahoe pattern: floating Liquid Glass capsules
   that group the toolbar controls instead of edge-attached bars.
   Same 4-layer rim shadow as sw-dialog-card / sw-sidebar-sheet. */
.sw-mv-island-toolbar {
  margin: 12px 14px 0;
  padding: 7px 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(28, 28, 30, 0.62);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
          backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.28),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.16),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    0 8px 24px -8px rgba(0, 0, 0, 0.36),
    0 1px 3px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 5;
}
:root[data-theme="light"] .sw-mv-island-toolbar {
  background: rgba(248, 248, 248, 0.72);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    0 8px 24px -8px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Hairline divider between island sections (used to split clusters
   of buttons inside the toolbar island, e.g. filters | search | size). */
.sw-mv-island-sep {
  width: 0.5px;
  height: 18px;
  background: var(--sw-separator);
  flex-shrink: 0;
  margin: 0 2px;
}

/* Search field tuned for the toolbar island — capsule shape,
   slightly narrower than the default sw-searchfield. */
.sw-mv-island-toolbar .sw-searchfield {
  border-radius: 999px;
  height: 28px;
  padding-left: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
.sw-mv-island-toolbar .sw-searchfield input {
  font-size: 12.5px;
}

.sw-mv-island-bottom {
  margin: 0 14px 12px;
  padding: 0;
  border-radius: 22px;
  background: rgba(28, 28, 30, 0.62);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
          backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.32),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    0 -4px 24px -8px rgba(0, 0, 0, 0.30),
    0 1px 3px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Task-log popover — floats directly above the bottom island and shares
   its margins so the two read as a stacked group. Same Liquid Glass
   chrome as the toolbar/bottom islands; collapses smoothly upward when
   the user closes it via the chevron. */
.sw-mv-island-tasklog {
  margin: 0 14px 8px;
  border-radius: 18px;
  background: rgba(28, 28, 30, 0.62);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
          backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.28),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.16),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    0 -2px 14px -6px rgba(0, 0, 0, 0.28),
    0 1px 3px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  /* Springy enter — matches the dialog/sidebar/picker iOS spring. */
  animation: sw-mv-tasklog-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
:root[data-theme="light"] .sw-mv-island-tasklog {
  background: rgba(248, 248, 248, 0.72);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}

@keyframes sw-mv-tasklog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1);     }
}

.sw-mv-island-tasklog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 160ms var(--sw-ease-emphasis);
}
.sw-mv-island-tasklog-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.sw-mv-island-tasklog-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sw-mv-island-tasklog-chevron {
  font-size: 11px;
  color: var(--sw-fg-tertiary);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sw-mv-island-tasklog.is-collapsed .sw-mv-island-tasklog-chevron {
  transform: rotate(-90deg);
}
.sw-mv-island-tasklog-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--sw-fg-secondary);
}

/* Animated body — uses grid-template-rows trick (0fr → 1fr) so the
   collapse animates the actual content height without measuring. */
.sw-mv-island-tasklog-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sw-mv-island-tasklog.is-collapsed .sw-mv-island-tasklog-body {
  grid-template-rows: 0fr;
}
.sw-mv-island-tasklog-body > div {
  overflow: hidden;
  min-height: 0;
}
.sw-mv-island-tasklog-content {
  /* Deliberately small: this log sits over the phone grid, and at 38vh a
     handful of lines swallowed a third of the page. It scrolls instead. */
  max-height: min(18vh, 140px);
  overflow-y: auto;
  padding: 4px 14px 12px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  font-size: 12px;
  line-height: 1.55;
  border-top: 0.5px solid var(--sw-separator);
}
.sw-mv-island-tasklog-content::-webkit-scrollbar { width: 6px; }
.sw-mv-island-tasklog-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.sw-mv-island-tasklog-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
}
.sw-mv-island-tasklog-row .ts {
  color: var(--sw-fg-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
:root[data-theme="light"] .sw-mv-island-bottom {
  background: rgba(248, 248, 248, 0.72);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}

.sw-mv-island-batch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 6px;
}

.sw-mv-island-divider {
  height: 0.5px;
  background: var(--sw-separator);
  margin: 0;
}

.sw-mv-island-input-row {
  padding: 6px 6px 6px 4px;
  display: flex;
  align-items: end;
  gap: 4px;
  position: relative;
}

/* Buttons inside the prompt-bar (used by both single-view chat and the
   bottom island in multi-view). 32×32 ghost capsule that lights up on
   hover; the dedicated send-btn turns into a tinted blue capsule when
   the message + selection are both ready. */
.sw-mv-island-input-row .prompt-bar-btn,
.prompt-bar .prompt-bar-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--sw-fg-secondary);
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 160ms var(--sw-ease-emphasis),
              color 160ms var(--sw-ease-emphasis),
              transform 100ms var(--sw-ease-standard);
}
.prompt-bar .prompt-bar-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: var(--sw-label);
}
.prompt-bar .prompt-bar-btn:active:not(:disabled) { transform: scale(0.92); }
.prompt-bar .prompt-bar-btn:disabled { cursor: not-allowed; opacity: 0.35; }

.prompt-bar .prompt-bar-btn.send-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sw-fg-secondary);
}
.prompt-bar .prompt-bar-btn.send-btn.send-btn-active {
  background: rgba(var(--sw-blue-rgb), 0.92);
  color: #fff;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.36),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(var(--sw-blue-rgb), 0.30);
}
.prompt-bar .prompt-bar-btn.send-btn.send-btn-active:hover {
  background: rgba(var(--sw-blue-rgb), 1);
}

/* Textarea inside the bottom island — flush with the row, no border
   (the island chrome is the border), expands as the user types. */
.sw-mv-island-input-row textarea {
  flex: 1;
  min-height: 32px;
  max-height: 120px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--sw-label);
  font-size: 13.5px;
  line-height: 1.5;
  font-family: inherit;
  resize: none;
  padding: 7px 8px;
  letter-spacing: -0.005em;
}
.sw-mv-island-input-row textarea::placeholder { color: var(--sw-fg-tertiary); }
.sw-mv-island-input-row textarea:disabled { opacity: 0.5; cursor: not-allowed; }

/* Light-mode tweaks. */
:root[data-theme="light"] .prompt-bar .prompt-bar-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
}
:root[data-theme="light"] .prompt-bar .prompt-bar-btn.send-btn {
  background: rgba(0, 0, 0, 0.04);
}

/* Batch action buttons inside the island — rendered as Apple-style
   pill capsules. Keep the prominent (Start) and clear (Stop)
   variants but trim padding to fit the island chrome. */
.sw-mv-island-batch-row .sw-btn-small {
  height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
}

@media (prefers-reduced-motion: reduce) {
  .sw-mv-island-toolbar,
  .sw-mv-island-bottom { transition: none !important; }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Liquid Glass sidebar (floating sheet)                       │
   ╰──────────────────────────────────────────────────────────────╯
   iOS 26 / macOS Tahoe pattern: a single rounded rect surface
   that floats above content with margin on every side, so all 4
   corners show the rim refraction. Mirrors SwiftUI:

       .glassEffect(.regular, in: .rect(cornerRadius: 24))

   The 4-layer rim shadow recreates the Liquid Glass refraction:
     1. inset top:    bright top rim (light entering the glass)
     2. inset bottom: dark bottom rim (light exiting)
     3. inset left:   side refraction (subtle glancing highlight)
     4. drop shadow:  soft elevation shadow */
.sw-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.sw-sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 240ms cubic-bezier(0.32, 0.72, 0, 1);
}
.sw-sidebar-overlay.is-open .sw-sidebar-backdrop { opacity: 1; }
.sw-sidebar-overlay.is-closing .sw-sidebar-backdrop {
  opacity: 0;
  transition-duration: 180ms;
}
:root[data-theme="light"] .sw-sidebar-backdrop {
  background: rgba(0, 0, 0, 0.16);
}

.sw-sidebar-sheet {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 268px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  padding: 8px;
  background: rgba(28, 28, 30, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
          backdrop-filter: blur(40px) saturate(180%);
  color: var(--sw-label);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.34),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.20),
    inset 1px 0 0 rgba(255, 255, 255, 0.10),
    inset -1px 0 0 rgba(0, 0, 0, 0.10),
    0 18px 48px -8px rgba(0, 0, 0, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.30);
  transform: translateX(28px) scale(0.97);
  opacity: 0;
  transition:
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 220ms cubic-bezier(0.16, 1, 0.3, 1);
  isolation: isolate;
}
.sw-sidebar-overlay.is-open .sw-sidebar-sheet {
  transform: translateX(0) scale(1);
  opacity: 1;
}
.sw-sidebar-overlay.is-closing .sw-sidebar-sheet {
  transform: translateX(20px) scale(0.98);
  opacity: 0;
  transition-duration: 200ms;
}
:root[data-theme="light"] .sw-sidebar-sheet {
  background: rgba(248, 248, 248, 0.82);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    inset -1px 0 0 rgba(0, 0, 0, 0.04),
    0 18px 48px -8px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.sw-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
}
.sw-sidebar-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-fg-tertiary);
}
.sw-sidebar-close {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  color: var(--sw-fg-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: background 160ms var(--sw-ease-emphasis),
              color 160ms var(--sw-ease-emphasis),
              transform 100ms var(--sw-ease-standard);
}
.sw-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--sw-label);
}
.sw-sidebar-close:active { transform: scale(0.92); }
:root[data-theme="light"] .sw-sidebar-close {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .sw-sidebar-close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.sw-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-sidebar-nav::-webkit-scrollbar { width: 4px; }
.sw-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
}

.sw-sidebar-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--sw-fg-tertiary);
  padding: 14px 12px 4px;
}

/* Nav item — pill capsule, subtle hover, prominent active state.
   Mirrors SwiftUI .glassEffect(.regular.interactive(), in: .capsule)
   for inactive items, .prominent for the selected one. */
.sw-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--sw-fg-secondary);
  text-decoration: none;
  background: transparent;
  border: 0.5px solid transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition:
    background 160ms var(--sw-ease-emphasis),
    color 160ms var(--sw-ease-emphasis),
    border-color 160ms var(--sw-ease-emphasis),
    transform 180ms var(--sw-ease-emphasis);
}
.sw-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sw-label);
  transform: scale(1.025);
}
.sw-sidebar-item:active { transform: scale(0.985); }
.sw-sidebar-item .ph,
.sw-sidebar-item .ph-fill,
.sw-sidebar-item .ph-bold {
  font-size: 16px;
  flex-shrink: 0;
  color: var(--sw-fg-tertiary);
  transition: color 160ms var(--sw-ease-emphasis);
}
.sw-sidebar-item:hover .ph,
.sw-sidebar-item:hover .ph-fill,
.sw-sidebar-item:hover .ph-bold {
  color: var(--sw-fg-secondary);
}

/* Active nav item — Liquid Glass prominent capsule.
   Subtle blue-tinted body + bright top rim + inner glow. */
.sw-sidebar-item.is-active {
  background: rgba(var(--sw-blue-rgb), 0.16);
  color: var(--sw-label);
  border-color: rgba(var(--sw-blue-rgb), 0.22);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.20),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.10);
}
.sw-sidebar-item.is-active .ph,
.sw-sidebar-item.is-active .ph-fill,
.sw-sidebar-item.is-active .ph-bold {
  color: var(--sw-blue);
}

:root[data-theme="light"] .sw-sidebar-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
:root[data-theme="light"] .sw-sidebar-item.is-active {
  background: rgba(var(--sw-blue-rgb), 0.10);
  border-color: rgba(var(--sw-blue-rgb), 0.18);
}

.sw-sidebar-divider {
  height: 0.5px;
  margin: 8px 8px;
  background: var(--sw-separator);
}

@media (prefers-reduced-motion: reduce) {
  .sw-sidebar-sheet,
  .sw-sidebar-backdrop {
    transition: none !important;
  }
  .sw-sidebar-overlay.is-open .sw-sidebar-sheet {
    transform: none;
  }
  .sw-sidebar-item:hover,
  .sw-sidebar-item:active {
    transform: none;
  }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Phone-control bottom cluster                                │
   ╰──────────────────────────────────────────────────────────────╯
   Apple Liquid Glass capsule (16px radius — softer than full pill,
   harder than the modal's 12px). Used for Start/Stop, Run Workflow,
   and the HID/tools mini-clusters next to the phone preview. */
.sw-btn-cluster {
  border-radius: 16px !important;
  height: 38px;
  font-size: 14px;
  letter-spacing: -0.01em;
  gap: 6px;
}
.sw-btn-cluster:active { transform: scale(0.97); }

/* The two side-by-side pills wrapping the HID buttons + tools buttons.
   GlassEffectContainer body, slightly bigger radius than its children
   so the rim refraction visibly tucks the buttons inside. */
.sw-cluster-pill {
  border-radius: 16px !important;
  padding: 4px;
  gap: 2px;
  height: 44px;
  align-self: stretch;
}

/* Icon buttons inside the cluster: 36×36 capsule, full glass body so
   they read as taps from the system tint, not flat squares. Phosphor
   icon size is set inline (text-[18px]) on the markup. */
.sw-btn-cluster-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
  flex: 1 1 0;
  min-width: 0;
}

/* Pulsing live dot used on the Start button when the VM is running.
   Pure CSS — fades in/out softly instead of a hard flash. */
.sw-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.65);
  animation: sw-pulse-fade 1.6s var(--sw-ease-standard) infinite;
}
@keyframes sw-pulse-fade {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.78); }
}
@media (prefers-reduced-motion: reduce) {
  .sw-pulse-dot { animation: none; opacity: 1; }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Toggle (iOS Switch)                                         │
   ╰──────────────────────────────────────────────────────────────╯
   iOS Toggle: 51x31. Off=fill-secondary, On=systemGreen. */
.sw-toggle {
  --sw-toggle-w: 51px;
  --sw-toggle-h: 31px;
  --sw-toggle-knob: 27px;
  position: relative;
  display: inline-block;
  width: var(--sw-toggle-w);
  height: var(--sw-toggle-h);
  flex-shrink: 0;
}
.sw-toggle-mac {
  --sw-toggle-w: 26px;
  --sw-toggle-h: 15px;
  --sw-toggle-knob: 13px;
}
.sw-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw-toggle .sw-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--sw-fill-secondary);
  border-radius: 9999px;
  transition: background-color 200ms var(--sw-ease-emphasis);
  cursor: pointer;
}
.sw-toggle .sw-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: var(--sw-toggle-knob);
  height: var(--sw-toggle-knob);
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.06);
  transition: transform 200ms var(--sw-ease-emphasis), background-color 200ms;
  pointer-events: none;
}
.sw-toggle input:checked ~ .sw-toggle-track { background: var(--sw-green); }
.sw-toggle input:checked ~ .sw-toggle-knob {
  transform: translateX(calc(var(--sw-toggle-w) - var(--sw-toggle-knob) - 4px));
}
.sw-toggle input:focus-visible ~ .sw-toggle-track {
  box-shadow: 0 0 0 3px var(--sw-keyboard-focus-ring);
}
.sw-toggle input:disabled ~ .sw-toggle-track,
.sw-toggle input:disabled ~ .sw-toggle-knob { opacity: 0.5; }

/* ╭──────────────────────────────────────────────────────────────╮
   │  Segmented control (iOS)                                     │
   ╰──────────────────────────────────────────────────────────────╯
   iOS dark: bg=rgba(255,255,255,0.10), active-bg=rgba(255,255,255,0.14)
   iOS light: bg=rgba(0,0,0,0.07), active-bg=#FFFFFF + shadow
   Padding 2px outer, 4px gap between buttons. */
.sw-segmented {
  display: inline-flex;
  align-items: stretch;
  padding: 3px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 50%),
    rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
:root[data-theme="light"] .sw-segmented {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 50%),
    rgba(0, 0, 0, 0.06);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.sw-segmented-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--sw-label);
  font-family: var(--sw-font-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.008em;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 150ms var(--sw-ease-standard), color 150ms;
  white-space: nowrap;
  user-select: none;
}
.sw-segmented-item[aria-selected="true"],
.sw-segmented-item.is-selected {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0.04) 50%),
    rgba(255, 255, 255, 0.18);
  color: var(--sw-label);
  font-weight: 600;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    0 2px 4px rgba(0, 0, 0, 0.30);
}
:root[data-theme="light"] .sw-segmented-item[aria-selected="true"],
:root[data-theme="light"] .sw-segmented-item.is-selected {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 2px 2px rgba(0,0,0,0.10);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Text field / Textarea                                       │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-textfield {
  display: inline-block;
  width: 100%;
  height: var(--sw-h-large);
  padding: 0 12px;
  background: var(--sw-fill-tertiary);
  color: var(--sw-label);
  border: 0;
  border-radius: 10px;
  font-family: var(--sw-font-text);
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -0.020em;
  outline: 0;
  transition: background-color 120ms, box-shadow 120ms;
}
.sw-textfield::placeholder { color: var(--sw-placeholder); }
.sw-textfield:hover { background: var(--sw-fill-secondary); }
.sw-textfield:focus,
.sw-textfield:focus-visible {
  background: var(--sw-fill-secondary);
  box-shadow: 0 0 0 3px var(--sw-keyboard-focus-ring);
}
.sw-textfield:disabled { opacity: 0.5; cursor: not-allowed; }

textarea.sw-textfield {
  height: auto;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.4;
}

/* Bezeled / outlined variant (used in macOS contexts) */
.sw-textfield-bezeled {
  background: var(--sw-content-bg);
  border: 1px solid var(--sw-separator);
  border-radius: 6px;
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
  letter-spacing: -0.008em;
}

/* Searchbar — pill, 44px, 17px */
.sw-searchfield {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--sw-fill-tertiary);
  width: 100%;
}
.sw-searchfield input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--sw-font-text);
  font-size: 17px;
  letter-spacing: -0.020em;
  color: var(--sw-label);
  padding: 0;
}
.sw-searchfield input::placeholder { color: var(--sw-placeholder); }
.sw-searchfield i,
.sw-searchfield svg { color: var(--sw-secondary-label); flex-shrink: 0; }
.sw-searchfield:focus-within { box-shadow: 0 0 0 3px var(--sw-keyboard-focus-ring); }

/* ╭──────────────────────────────────────────────────────────────╮
   │  Card / GroupBox                                             │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-card {
  background: var(--sw-secondary-grouped-bg);
  border-radius: var(--sw-radius-inset);
  overflow: hidden;
}
.sw-card-padded { padding: var(--sw-space-4); }
.sw-card-bordered {
  border: 0.5px solid var(--sw-separator);
  background: var(--sw-secondary-grouped-bg);
}
.sw-card-elevated {
  background: var(--sw-secondary-grouped-bg);
  border-radius: var(--sw-radius-inset);
  box-shadow: var(--sw-shadow-md);
}
.sw-card-glass {
  background: var(--sw-material-regular-bg);
  -webkit-backdrop-filter: var(--sw-material-regular-blur);
  backdrop-filter: var(--sw-material-regular-blur);
  border-radius: var(--sw-radius-inset);
  border: 0.5px solid var(--sw-separator);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Sheet / modal                                               │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* iOS 26 partial-height sheet: Liquid Glass, floats above content with
   curved edges that nest into device corners. Header sits on glass; body
   below it remains opaque (content layer per Apple HIG). */
.sw-sheet {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 30%),
    rgba(28, 28, 30, 0.78);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(110%);
          backdrop-filter: blur(40px) saturate(180%) brightness(110%);
  border-radius: 28px;                    /* approximate device corner radius */
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 -8px 36px rgba(0, 0, 0, 0.45),
    0 24px 56px rgba(0, 0, 0, 0.60);
  overflow: hidden;
}
:root[data-theme="light"] .sw-sheet {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.10) 30%),
    rgba(255, 255, 255, 0.78);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 -8px 36px rgba(0, 0, 0, 0.10),
    0 24px 56px rgba(0, 0, 0, 0.18);
}
.sw-sheet-half {
  border-radius: 28px 28px 0 0;
}
.sw-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sw-space-4) var(--sw-space-4) var(--sw-space-3);
  border-bottom: 0.5px solid var(--sw-separator);
}
.sw-sheet-title {
  font-family: var(--sw-font-text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.020em;
  color: var(--sw-label);
}
.sw-sheet-body { padding: var(--sw-space-4); }
.sw-sheet-grabber {
  width: 36px;
  height: 5px;
  border-radius: 2.5px;
  background: var(--sw-fill-secondary);
  margin: 6px auto 0;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Tab bar (iOS bottom)                                        │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-tabbar {
  display: flex;
  align-items: stretch;
  background: var(--sw-material-thick-bg);
  -webkit-backdrop-filter: var(--sw-material-thick-blur);
  backdrop-filter: var(--sw-material-thick-blur);
  border-top: 0.5px solid var(--sw-separator);
  height: 49px;
  padding-bottom: env(safe-area-inset-bottom);
}
.sw-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding-top: 4px;
  font-size: 10px;
  letter-spacing: 0.01em;
  font-weight: 500;
  color: var(--sw-secondary-label);
  border: 0;
  background: transparent;
  cursor: pointer;
}
.sw-tabbar-item.is-active { color: var(--sw-blue); }

/* ╭──────────────────────────────────────────────────────────────╮
   │  Badge / Tag                                                 │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  height: 20px;
  border-radius: 10px;
  font-family: var(--sw-font-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.004em;
  background: var(--sw-fill-tertiary);
  color: var(--sw-secondary-label);
  white-space: nowrap;
}
.sw-badge-blue   { background: rgba(var(--sw-blue-rgb),   0.18); color: var(--sw-blue); }
.sw-badge-green  { background: rgba(var(--sw-green-rgb),  0.18); color: var(--sw-green); }
.sw-badge-red    { background: rgba(var(--sw-red-rgb),    0.18); color: var(--sw-red); }
.sw-badge-orange { background: rgba(var(--sw-orange-rgb), 0.18); color: var(--sw-orange); }
.sw-badge-purple { background: rgba(var(--sw-purple-rgb), 0.18); color: var(--sw-purple); }
.sw-badge-yellow { background: color-mix(in srgb, var(--sw-yellow) 18%, transparent); color: var(--sw-yellow); }
.sw-badge-teal   { background: color-mix(in srgb, var(--sw-teal) 18%, transparent); color: var(--sw-teal); }
.sw-badge-gray   { background: var(--sw-fill-tertiary); color: var(--sw-secondary-label); }
.sw-badge-dot {
  /* Tiny circular notification dot */
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sw-red);
}

/* Status dot — "live" indicator with pulsing ring */
.sw-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sw-gray);
  flex-shrink: 0;
}
.sw-status-dot.live {
  background: var(--sw-green);
  color: var(--sw-green);
  box-shadow: 0 0 0 0 currentColor;
  animation: sw-pulse 1.8s var(--sw-ease-decel) infinite;
}
@keyframes sw-pulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in srgb, currentColor 55%, transparent); }
  70%  { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor  0%, transparent); }
  100% { box-shadow: 0 0 0 0   color-mix(in srgb, currentColor  0%, transparent); }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Progress / Spinner                                          │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-progress {
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: var(--sw-fill-tertiary);
  overflow: hidden;
}
.sw-progress-bar {
  height: 100%;
  background: var(--sw-blue);
  border-radius: inherit;
  transition: width 400ms var(--sw-ease-decel);
}
.sw-progress-bar.is-success { background: var(--sw-green); }
.sw-progress-bar.is-warning { background: var(--sw-orange); }
.sw-progress-bar.is-danger  { background: var(--sw-red); }

.sw-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--sw-fill-tertiary);
  border-top-color: var(--sw-secondary-label);
  animation: sw-spin 0.8s linear infinite;
}
@keyframes sw-spin { to { transform: rotate(360deg); } }

/* iOS preloader (12 fading bars in a circle) — luxurious version */
.sw-preloader {
  width: 20px;
  height: 20px;
  position: relative;
  display: inline-block;
}
.sw-preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    conic-gradient(from 0deg,
      rgba(var(--sw-blue-rgb), 0.0) 0%,
      rgba(var(--sw-blue-rgb), 1.0) 100%);
  -webkit-mask: radial-gradient(circle, transparent 35%, black 36%);
          mask: radial-gradient(circle, transparent 35%, black 36%);
  border-radius: 50%;
  animation: sw-spin 0.9s linear infinite;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Stepper (NSStepper / iOS Stepper)                           │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-stepper {
  display: inline-flex;
  background: var(--sw-fill-tertiary);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}
.sw-stepper-btn {
  width: 47px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--sw-label);
  cursor: pointer;
  font-size: 20px;
  font-weight: 400;
  position: relative;
  transition: background-color 120ms;
}
.sw-stepper-btn:hover { background: var(--sw-fill-secondary); }
.sw-stepper-btn:active { background: var(--sw-fill-primary); }
.sw-stepper-btn + .sw-stepper-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--sw-separator);
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Helpers                                                     │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-hstack { display: flex; flex-direction: row; align-items: center; gap: var(--sw-space-2); }
.sw-vstack { display: flex; flex-direction: column; gap: var(--sw-space-2); }
.sw-spacer { flex: 1; }
.sw-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sw-rounded-pill { border-radius: 9999px; }
.sw-rounded-inset { border-radius: var(--sw-radius-inset); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sw-btn, .sw-toggle .sw-toggle-knob, .sw-toggle .sw-toggle-track,
  .sw-segmented-item, .sw-list-row, .sw-progress-bar, .sw-spinner,
  .sw-preloader::before, .sw-status-dot.live {
    transition: none !important;
    animation: none !important;
  }
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Page shell helpers                                          │
   ╰──────────────────────────────────────────────────────────────╯ */
.sw-page {
  background: var(--sw-grouped-bg);
  min-height: 100%;
}
.sw-page-content {
  padding-top: 8px;
  padding-bottom: 35px;
}
.sw-page-large-title-block {
  padding: 8px var(--sw-space-4) 16px;
}

/* ╭──────────────────────────────────────────────────────────────╮
   │  Workflows page — Liquid Glass islands + prism light edges   │
   ╰──────────────────────────────────────────────────────────────╯
   Same 4-layer rim shadow language as sw-mv-island-toolbar /
   sw-dialog-card / sw-sidebar-sheet. The chromatic dispersion
   highlight on the cards uses the shared #sw-prism-edge SVG filter
   (defined in base.html) so the rainbow fringe is real subpixel
   refraction, not a baked gradient. */

/* Sticky header — full-bleed Liquid Glass bar with refraction.
   Replaces the old translucent strip with a proper glass surface
   that picks up scrolled content underneath. */
.sw-wf-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(28, 28, 30, 0.55);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(28px) saturate(180%) url(#sw-glass-refract);
          backdrop-filter: blur(28px) saturate(180%) url(#sw-glass-refract);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.18),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.20),
    0 8px 24px -16px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] .sw-wf-header {
  background: rgba(248, 248, 248, 0.68);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    0 8px 24px -16px rgba(0, 0, 0, 0.10);
}
@supports not (backdrop-filter: url(#sw-glass-refract)) {
  .sw-wf-header { backdrop-filter: blur(20px) saturate(180%); }
}

/* Floating capsule that groups search + filters + view toggle +
   actions into one glass island (Apple HIG: GlassEffectContainer). */
.sw-wf-toolbar-island {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 14px 12px;
  padding: 6px 8px;
  border-radius: 16px;
  background: rgba(28, 28, 30, 0.62);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(28px) saturate(180%) url(#sw-glass-refract);
          backdrop-filter: blur(28px) saturate(180%) url(#sw-glass-refract);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.28),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.16),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    0 8px 24px -8px rgba(0, 0, 0, 0.36),
    0 1px 3px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .sw-wf-toolbar-island {
  background: rgba(248, 248, 248, 0.72);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    0 8px 24px -8px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.04);
}
@supports not (backdrop-filter: url(#sw-glass-refract)) {
  .sw-wf-toolbar-island { backdrop-filter: blur(20px) saturate(180%); }
}

/* Inside the island the search field becomes a capsule, segmented
   pill stays full-height, and bordered buttons drop their borders
   so the island chrome is the only frame (per Apple HIG: avoid
   stacked glass-on-glass). */
.sw-wf-toolbar-island .sw-searchfield {
  border-radius: 999px;
  height: 28px;
  padding-left: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  /* Was a hard 200px, which left the input 145px against a 176px placeholder —
     "Search name, tag, description" got clipped mid-word ("…descrip") with no
     ellipsis whenever the toolbar tightened. 224px is the measured need (176
     text + 28 icon gutter + 12 right pad + slack); flex lets it take slack on
     wide bars and wrap to its own row instead of squeezing on narrow ones. */
  flex: 1 1 224px;
  min-width: 224px;
  max-width: 320px;
}
.sw-wf-toolbar-island .sw-searchfield input { font-size: 12.5px; }
:root[data-theme="light"] .sw-wf-toolbar-island .sw-searchfield {
  background: rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.sw-wf-toolbar-island .sw-segmented {
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
:root[data-theme="light"] .sw-wf-toolbar-island .sw-segmented {
  background: rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.sw-wf-toolbar-island .sw-btn-bordered {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.sw-wf-toolbar-island .sw-btn-bordered:hover {
  background: rgba(255, 255, 255, 0.08);
}
:root[data-theme="light"] .sw-wf-toolbar-island .sw-btn-bordered {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
}
.sw-wf-toolbar-island select.sw-textfield-bezeled {
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  height: 28px;
  padding: 0 26px 0 12px;
  font-size: 12.5px;
}
:root[data-theme="light"] .sw-wf-toolbar-island select.sw-textfield-bezeled {
  background: rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.sw-wf-island-sep {
  width: 0.5px;
  height: 18px;
  background: var(--sw-separator);
  flex-shrink: 0;
  margin: 0 2px;
}

/* Selection action bar — pinned floating glass island with a faint
   blue tint so it reads as "active state" without screaming. */
.sw-wf-selection-island {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 14px 0;
  padding: 8px 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(var(--sw-blue-rgb), 0.14), rgba(var(--sw-blue-rgb), 0.08)),
    rgba(28, 28, 30, 0.62);
  border: 0.5px solid rgba(var(--sw-blue-rgb), 0.30);
  -webkit-backdrop-filter: blur(24px) saturate(180%) url(#sw-glass-refract);
          backdrop-filter: blur(24px) saturate(180%) url(#sw-glass-refract);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.16),
    0 6px 18px -6px rgba(var(--sw-blue-rgb), 0.30);
}
:root[data-theme="light"] .sw-wf-selection-island {
  background:
    linear-gradient(180deg, rgba(var(--sw-blue-rgb), 0.10), rgba(var(--sw-blue-rgb), 0.05)),
    rgba(248, 248, 248, 0.72);
}

/* Glass card — the marquee element of the page. Translucent body,
   refractive backdrop, and a chromatic-prism halo on hover that
   traces the card's outline so the rainbow fringe only appears
   when the user is interacting with it (cheap on idle frames). */
.sw-wf-card {
  position: relative;
  border-radius: 18px;
  padding: 16px;
  background: rgba(28, 28, 30, 0.50);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  color: var(--sw-label);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.18),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    0 4px 14px -6px rgba(0, 0, 0, 0.30);
  transition:
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 280ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 200ms ease;
  cursor: pointer;
  overflow: hidden;
}
:root[data-theme="light"] .sw-wf-card {
  background: rgba(255, 255, 255, 0.72);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.40),
    0 4px 14px -6px rgba(0, 0, 0, 0.10);
}
.sw-wf-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.20),
    inset 1px 0 0 rgba(255, 255, 255, 0.10),
    0 12px 30px -10px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] .sw-wf-card:hover {
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.95),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.05),
    inset 1px 0 0 rgba(255, 255, 255, 0.55),
    0 12px 30px -10px rgba(0, 0, 0, 0.18);
}
/* Top "rim of the glass" highlight — extra hairline that catches
   light at the very top of the card, exactly like the meniscus on
   a glass surface in real iOS 26 controls. */
.sw-wf-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 30%);
  mix-blend-mode: screen;
  opacity: 0.7;
}
/* Chromatic prism halo — only appears on hover. Two stacked
   pseudo-shadows offset in opposite directions in red/blue create
   the classic dispersion fringe (cheap, GPU-only, no filter pass). */
.sw-wf-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
  background:
    /* red bleed off the bottom-right */
    radial-gradient(120% 80% at 100% 100%, rgba(255, 80, 80, 0.18), transparent 55%),
    /* blue bleed off the top-left */
    radial-gradient(120% 80% at 0% 0%,     rgba(80, 140, 255, 0.18), transparent 55%);
  mix-blend-mode: screen;
  filter: blur(0.5px);
}
.sw-wf-card:hover::after,
.sw-wf-card.is-selected::after { opacity: 1; }

.sw-wf-card.is-selected {
  border-color: rgba(var(--sw-blue-rgb), 0.55);
  box-shadow:
    0 0 0 1px rgba(var(--sw-blue-rgb), 0.45),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.20),
    0 10px 26px -10px rgba(var(--sw-blue-rgb), 0.40);
}

/* Platform tile inside the card — circular glass with prism edge
   so the platform icon sits in a tiny refractive bubble. */
.sw-wf-platform-tile {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background 160ms ease, transform 160ms ease, box-shadow 200ms ease;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.20),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.10);
}
:root[data-theme="light"] .sw-wf-platform-tile {
  background: rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.sw-wf-platform-tile:hover {
  background: rgba(255, 255, 255, 0.10);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.10),
    0 4px 10px -4px rgba(0, 0, 0, 0.30);
}
:root[data-theme="light"] .sw-wf-platform-tile:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Tag chip — capsule glass with inset rim, replaces the flat tag */
.sw-wf-tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  color: var(--sw-secondary-label);
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.16);
}
:root[data-theme="light"] .sw-wf-tag {
  background: rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.05);
}

/* Popover (platform picker / row menu) — glass surface to match
   the rest of the page instead of the previously opaque sheet. */
.sw-wf-popover {
  position: absolute;
  background: rgba(28, 28, 30, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(36px) saturate(180%);
          backdrop-filter: blur(36px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    0 12px 36px -8px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.30);
  padding: 4px;
  z-index: 50;
  min-width: 160px;
}
:root[data-theme="light"] .sw-wf-popover {
  background: rgba(248, 248, 248, 0.92);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.85),
    0 12px 36px -8px rgba(0, 0, 0, 0.20),
    0 2px 8px rgba(0, 0, 0, 0.06);
}
.sw-wf-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--sw-secondary-label);
  border-radius: 8px;
  transition: background 0.12s ease, color 0.12s ease;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.sw-wf-popover-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sw-label);
}
:root[data-theme="light"] .sw-wf-popover-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
.sw-wf-popover-item.is-danger { color: var(--sw-red); }
.sw-wf-popover-item.is-danger:hover {
  background: rgba(var(--sw-red-rgb), 0.14);
  color: var(--sw-red);
}

/* Empty-state icon — same glass tile language as platform tile */
.sw-wf-empty-icon {
  width: 72px; height: 72px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.10),
    0 6px 18px -8px rgba(0, 0, 0, 0.30);
}
:root[data-theme="light"] .sw-wf-empty-icon {
  background: rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}

/* Table view — keep the grid but wrap it in a glass shell to match
   the cards. Hover row uses a faint blue wash. */
.sw-wf-table-shell {
  margin: 0 14px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(28, 28, 30, 0.50);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.18),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.18),
    0 4px 14px -6px rgba(0, 0, 0, 0.30);
}
:root[data-theme="light"] .sw-wf-table-shell {
  background: rgba(255, 255, 255, 0.72);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.sw-wf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.sw-wf-table thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sw-tertiary-label);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 0.5px solid var(--sw-separator);
  background: rgba(255, 255, 255, 0.03);
}
:root[data-theme="light"] .sw-wf-table thead th {
  background: rgba(0, 0, 0, 0.02);
}
.sw-wf-table tbody td {
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--sw-separator);
  color: var(--sw-label);
  vertical-align: middle;
}
.sw-wf-table tbody tr:last-child td { border-bottom: 0; }
.sw-wf-table tbody tr {
  transition: background 0.15s ease;
  cursor: pointer;
}
.sw-wf-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="light"] .sw-wf-table tbody tr:hover { background: rgba(0, 0, 0, 0.025); }
.sw-wf-table tbody tr.is-selected { background: rgba(var(--sw-blue-rgb), 0.10); }
.sw-wf-table tbody tr.is-selected:hover { background: rgba(var(--sw-blue-rgb), 0.13); }

/* Run-button on a card — capsule prism-tinted glass that reads as
   the per-card primary action without competing with the toolbar
   "New Workflow" CTA. */
.sw-wf-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: rgb(var(--sw-blue-rgb));
  background:
    linear-gradient(180deg, rgba(var(--sw-blue-rgb), 0.22), rgba(var(--sw-blue-rgb), 0.14));
  border: 0.5px solid rgba(var(--sw-blue-rgb), 0.32);
  cursor: pointer;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.10);
  transition: background 160ms ease, transform 100ms ease, box-shadow 200ms ease;
}
.sw-wf-run-btn:hover {
  background:
    linear-gradient(180deg, rgba(var(--sw-blue-rgb), 0.32), rgba(var(--sw-blue-rgb), 0.20));
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.35),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.10),
    0 4px 12px -4px rgba(var(--sw-blue-rgb), 0.40);
}
.sw-wf-run-btn:active { transform: scale(0.96); }

/* Triple-dot menu button on the card — tiny ghost capsule that
   only fades in on card hover (Apple's "secondary affordance"
   pattern: discoverable without distracting at rest). */
.sw-wf-card-menu-btn {
  width: 26px; height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  color: var(--sw-fg-secondary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 160ms ease, background 140ms ease, transform 100ms ease;
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}
:root[data-theme="light"] .sw-wf-card-menu-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.sw-wf-card:hover .sw-wf-card-menu-btn,
.sw-wf-card-menu-btn.is-open { opacity: 1; }
.sw-wf-card-menu-btn:hover { background: rgba(255, 255, 255, 0.14); color: var(--sw-label); }
.sw-wf-card-menu-btn:active { transform: scale(0.92); }

/* Footer meta row inside the card uses a hairline that matches
   the card's inner-rim language (slightly brighter than the
   default --sw-separator so it doesn't disappear on glass). */
.sw-wf-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}
:root[data-theme="light"] .sw-wf-card-footer {
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

/* Modal sheet — apply prism dispersion at the rim of the Run /
   Bulk Import modals so they read as the same Liquid Glass family
   as the cards underneath. */
.sw-wf-modal-card {
  position: relative;
  border-radius: 24px;
  background: rgba(28, 28, 30, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(40px) saturate(180%) url(#sw-prism-edge);
          backdrop-filter: blur(40px) saturate(180%) url(#sw-prism-edge);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.34),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.20),
    inset 1px 0 0 rgba(255, 255, 255, 0.10),
    0 16px 48px -8px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}
:root[data-theme="light"] .sw-wf-modal-card {
  background: rgba(248, 248, 248, 0.86);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.92),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.55),
    0 16px 48px -8px rgba(0, 0, 0, 0.20),
    0 2px 8px rgba(0, 0, 0, 0.06);
}
@supports not (backdrop-filter: url(#sw-prism-edge)) {
  .sw-wf-modal-card { backdrop-filter: blur(40px) saturate(180%); }
}
/* Top edge: stronger meniscus highlight with a faint chromatic tint
   so even browsers without SVG-filter support get a hint of the
   prism effect from a CSS-only gradient. */
.sw-wf-modal-card::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 80, 80, 0)    0%,
    rgba(255, 80, 80, 0.45) 12%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(80, 140, 255, 0.45) 88%,
    rgba(80, 140, 255, 0)   100%
  );
  mix-blend-mode: screen;
  opacity: 0.75;
}

/* Phone-pick row inside the Run modal — capsule glass list rows
   with a subtle inset rim so checked rows read as "selected". */
.sw-wf-phone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 140ms ease;
}
.sw-wf-phone-row:hover { background: rgba(255, 255, 255, 0.05); }
:root[data-theme="light"] .sw-wf-phone-row:hover { background: rgba(0, 0, 0, 0.04); }
.sw-wf-phone-row.is-checked {
  background: rgba(var(--sw-blue-rgb), 0.10);
  box-shadow: inset 0 0 0 0.5px rgba(var(--sw-blue-rgb), 0.30);
}

/* "Run mode" radio cards inside the Run modal — segmented glass tiles */
.sw-wf-run-mode {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.sw-wf-run-mode:hover { background: rgba(255, 255, 255, 0.07); }
.sw-wf-run-mode.is-active {
  background: rgba(var(--sw-blue-rgb), 0.12);
  border-color: rgba(var(--sw-blue-rgb), 0.35);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.22),
    0 0 0 1px rgba(var(--sw-blue-rgb), 0.20);
}
:root[data-theme="light"] .sw-wf-run-mode {
  background: rgba(0, 0, 0, 0.03);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .sw-wf-run-mode:hover { background: rgba(0, 0, 0, 0.05); }

/* Reduced-motion: drop card-hover lift & prism halo */
@media (prefers-reduced-motion: reduce) {
  .sw-wf-card,
  .sw-wf-card::after,
  .sw-wf-platform-tile,
  .sw-wf-card-menu-btn { transition: none; }
  .sw-wf-card:hover { transform: none; }
}
