/* YOWO AI Design System v2 (yowo-ui.css)
 * Backward-compatible upgrade over v1 yowo.css: preserves all --yowo-* primitive & component
 * names while introducing studio tonal surfaces, accessible terracotta accents, tiered tactile
 * radii, whisper elevation shadows, 4 product UI variants, and .yw-* component primitives.
 *
 * Self-hosted fonts only: load your local yowo-fonts.css (Manrope, Noto Sans SC, Recursive Mono)
 * before yowo-ui.css. Never load fonts from Google Fonts or external CDNs.
 */

:root {
  /* --------------------------------------------------------------------------
   * 1. Primitive Palette (v1 compatibility + v2 studio warm paper & ink)
   * -------------------------------------------------------------------------- */
  --yowo-color-ink: #141414;
  --yowo-color-black: #0E0E0D;
  --yowo-color-black-surface: #1A1A18;
  --yowo-color-black-line: #2E2D2A;
  --yowo-color-black-muted: #8A867D;
  --yowo-color-paper: #EDE8DC;
  --yowo-color-paper-surface: #F6F2E9;
  --yowo-color-paper-line: #CFC8B8;
  --yowo-color-paper-muted: #6A665D;
  --yowo-color-orange: #C9633A;
  --yowo-color-orange-surface: #BD5C35;
  --yowo-color-orange-line: #B35532;
  --yowo-color-orange-muted: #4E2412;
  --yowo-color-blue: #26407F;
  --yowo-color-blue-surface: #213872;
  --yowo-color-blue-line: #3A538F;
  --yowo-color-blue-muted: #A9B3CF;
  --yowo-color-gold: #DFA23D;
  --yowo-color-ochre: #DCA542;
  --yowo-color-ochre-surface: #E4B55E;
  --yowo-color-ochre-line: #C4903A;
  --yowo-color-ochre-muted: #4F3A11;
  --yowo-color-mountain: #27302E;
  --yowo-color-mountain-surface: #2F3936;
  --yowo-color-mountain-line: #3A4542;
  --yowo-color-mountain-muted: #97A09A;

  --yowo-color-studio-paper: #F5F2EB;
  --yowo-color-studio-paper-sunken: #ECE7DD;
  --yowo-color-studio-paper-surface: #FCFBF8;
  --yowo-color-studio-paper-raised: #FFFFFF;
  --yowo-color-studio-ink: #161615;
  --yowo-color-studio-muted: #666159;
  --yowo-color-studio-faint: #968F84;
  --yowo-color-studio-line-solid: #DFD9CE;

  --yowo-color-studio-black-sunken: #090908;
  --yowo-color-studio-black-surface: #171715;
  --yowo-color-studio-black-raised: #21201D;
  --yowo-color-studio-black-fg: #EFECE4;
  --yowo-color-studio-black-muted: #969086;
  --yowo-color-studio-black-faint: #656058;
  --yowo-color-studio-black-line-solid: #2B2A27;

  --yowo-color-terracotta-strong-light: #B54D26;
  --yowo-color-terracotta-on-strong-light: #FFFDF9;
  --yowo-color-terracotta-strong-dark: #E47B52;
  --yowo-color-terracotta-on-strong-dark: #141210;

  --yowo-color-status-success-on-light: #2F6B4F;
  --yowo-color-status-warning-on-light: #8A5A0B;
  --yowo-color-status-error-on-light: #A8341F;
  --yowo-color-status-running-on-light: #26407F;
  --yowo-color-status-success-on-dark: #7FB596;
  --yowo-color-status-warning-on-dark: #DCA542;
  --yowo-color-status-error-on-dark: #E0705C;
  --yowo-color-status-running-on-dark: #8FA3D6;

  /* --------------------------------------------------------------------------
   * 2. Typography, Slash & Motion
   * -------------------------------------------------------------------------- */
  --yowo-font-family-sans: "Manrope", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --yowo-font-family-mono: "Recursive", "Noto Sans SC", ui-monospace, monospace;
  --yowo-font-family-cjk: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --yowo-font-weight-regular: 400;
  --yowo-font-weight-medium: 500;
  --yowo-font-weight-semibold: 600;
  --yowo-font-weight-bold: 700;
  --yowo-font-weight-extrabold: 800;
  --yowo-font-weight-black: 900;
  --yowo-font-mono-variation: "MONO" 1, "CASL" 0;

  --yowo-angle-slash: 17.76deg;

  --yowo-motion-ease-swing: cubic-bezier(0.22, 1, 0.36, 1);
  --yowo-motion-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --yowo-motion-ease-press: cubic-bezier(0.2, 0, 0, 1);
  --yowo-motion-duration-press: 35ms;
  --yowo-motion-duration-fast: 120ms;
  --yowo-motion-duration-base: 240ms;
  --yowo-motion-duration-slow: 480ms;
  --yowo-motion-duration-sting: 5300ms;

  /* --------------------------------------------------------------------------
   * 3. Tiered Tactile Radii & 4px Spacing Scale
   * -------------------------------------------------------------------------- */
  --yowo-radius-none: 0px;
  --yowo-radius-xs: 4px;
  --yowo-radius-sm: 6px;
  --yowo-radius-md: 10px;
  --yowo-radius-lg: 14px;
  --yowo-radius-full: 9999px;
  --yowo-radius-icon: 17.857%;

  --yowo-space-0: 0px;
  --yowo-space-1: 4px;
  --yowo-space-2: 8px;
  --yowo-space-3: 12px;
  --yowo-space-4: 16px;
  --yowo-space-5: 20px;
  --yowo-space-6: 24px;
  --yowo-space-8: 32px;
  --yowo-space-10: 40px;
  --yowo-space-12: 48px;
  --yowo-space-16: 64px;
  --yowo-space-20: 80px;
  --yowo-space-24: 96px;
  --yowo-space-30: 120px;
  --yowo-space-40: 160px;

  --yowo-film-title-safe: 0.1;
  --yowo-film-logo-width-16x9: 0.5;
  --yowo-film-logo-width-9x16: 0.72;

  /* --------------------------------------------------------------------------
   * 4. Type Scales (Poster Display + App UI Scale + v1 Compat Aliases)
   * -------------------------------------------------------------------------- */
  --yowo-type-display-xl-size: 128px;
  --yowo-type-display-xl-line-height: 0.88;
  --yowo-type-display-xl-tracking: -0.03em;
  --yowo-type-display-xl-weight: 800;

  --yowo-type-display-l-size: 100px;
  --yowo-type-display-l-line-height: 0.9;
  --yowo-type-display-l-tracking: -0.025em;
  --yowo-type-display-l-weight: 800;

  --yowo-type-display-m-size: 80px;
  --yowo-type-display-m-line-height: 0.92;
  --yowo-type-display-m-tracking: -0.02em;
  --yowo-type-display-m-weight: 800;

  --yowo-type-title-l-size: 64px;
  --yowo-type-title-l-line-height: 0.95;
  --yowo-type-title-l-tracking: -0.015em;
  --yowo-type-title-l-weight: 700;

  --yowo-type-title-m-size: 50px;
  --yowo-type-title-m-line-height: 1;
  --yowo-type-title-m-tracking: -0.01em;
  --yowo-type-title-m-weight: 700;

  --yowo-type-title-s-size: 40px;
  --yowo-type-title-s-line-height: 1;
  --yowo-type-title-s-tracking: -0.01em;
  --yowo-type-title-s-weight: 700;

  --yowo-type-heading-l-size: 32px;
  --yowo-type-heading-l-line-height: 1.15;
  --yowo-type-heading-l-tracking: -0.01em;
  --yowo-type-heading-l-weight: 600;

  --yowo-type-heading-m-size: 24px;
  --yowo-type-heading-m-line-height: 1.25;
  --yowo-type-heading-m-tracking: -0.01em;
  --yowo-type-heading-m-weight: 600;

  --yowo-type-heading-s-size: 20px;
  --yowo-type-heading-s-line-height: 1.3;
  --yowo-type-heading-s-tracking: -0.005em;
  --yowo-type-heading-s-weight: 600;

  --yowo-type-heading-xs-size: 16px;
  --yowo-type-heading-xs-line-height: 1.35;
  --yowo-type-heading-xs-tracking: -0.005em;
  --yowo-type-heading-xs-weight: 600;

  --yowo-type-reading-size: 16px;
  --yowo-type-reading-line-height: 1.85;
  --yowo-type-reading-tracking: 0em;
  --yowo-type-reading-weight: 400;

  --yowo-type-ui-md-size: 15px;
  --yowo-type-ui-md-line-height: 1.5;
  --yowo-type-ui-md-tracking: 0em;
  --yowo-type-ui-md-weight: 400;

  --yowo-type-ui-base-size: 14px;
  --yowo-type-ui-base-line-height: 1.5;
  --yowo-type-ui-base-tracking: 0em;
  --yowo-type-ui-base-weight: 400;

  --yowo-type-ui-sm-size: 13px;
  --yowo-type-ui-sm-line-height: 1.45;
  --yowo-type-ui-sm-tracking: 0em;
  --yowo-type-ui-sm-weight: 400;

  --yowo-type-label-size: 12px;
  --yowo-type-label-line-height: 1.35;
  --yowo-type-label-tracking: 0.06em;
  --yowo-type-label-weight: 600;

  --yowo-type-ui-2xs-size: 11px;
  --yowo-type-ui-2xs-line-height: 1.35;
  --yowo-type-ui-2xs-tracking: 0.01em;
  --yowo-type-ui-2xs-weight: 500;

  /* v1 backward-compatible type variables */
  --yowo-type-body-size: 16px;
  --yowo-type-body-line-height: 1.5;
  --yowo-type-body-tracking: 0em;
  --yowo-type-body-weight: 400;

  --yowo-type-body-s-size: 14px;
  --yowo-type-body-s-line-height: 1.45;
  --yowo-type-body-s-tracking: 0em;
  --yowo-type-body-s-weight: 400;

  --yowo-type-label-s-size: 10px;
  --yowo-type-label-s-line-height: 1.4;
  --yowo-type-label-s-tracking: 0.08em;
  --yowo-type-label-s-weight: 400;
}

/* ----------------------------------------------------------------------------
 * 5. Themes: Light (swiss-paper) & Dark (mono-black) + System Auto
 * -------------------------------------------------------------------------- */
:root,
[data-theme="swiss-paper"],
[data-theme="light"],
[data-theme="auto"] {
  --yowo-bg: #F5F2EB;
  --yowo-bg-sunken: #ECE7DD;
  --yowo-surface: #FCFBF8;
  --yowo-surface-raised: #FFFFFF;
  --yowo-fg: #161615;
  --yowo-muted: #666159;
  --yowo-faint: #968F84;
  --yowo-line: rgba(22, 22, 21, 0.09);
  --yowo-line-solid: #DFD9CE;
  --yowo-border-strong: rgba(22, 22, 21, 0.22);
  --yowo-focus: #B54D26;

  --yowo-accent: #C9633A;
  --yowo-on-accent: #EDE8DC;
  --yowo-accent-strong: #B54D26;
  --yowo-on-accent-strong: #FFFDF9;
  --yowo-accent-soft: color-mix(in srgb, var(--yowo-accent) 11%, transparent);

  --yowo-status-success: #2F6B4F;
  --yowo-status-warning: #8A5A0B;
  --yowo-status-error: #A8341F;
  --yowo-status-running: #26407F;
  --yowo-status-success-soft: color-mix(in srgb, var(--yowo-status-success) 10%, transparent);
  --yowo-status-warning-soft: color-mix(in srgb, var(--yowo-status-warning) 11%, transparent);
  --yowo-status-error-soft: color-mix(in srgb, var(--yowo-status-error) 10%, transparent);
  --yowo-status-running-soft: color-mix(in srgb, var(--yowo-status-running) 10%, transparent);

  --yowo-shadow-xs: 0 1px 2px rgba(22, 22, 21, 0.04);
  --yowo-shadow-sm: 0 1px 3px rgba(22, 22, 21, 0.05), 0 4px 12px -4px rgba(22, 22, 21, 0.06);
  --yowo-shadow-md: 0 2px 6px rgba(22, 22, 21, 0.05), 0 10px 24px -6px rgba(22, 22, 21, 0.08);
  --yowo-shadow-float: 0 4px 12px rgba(22, 22, 21, 0.06), 0 18px 40px -10px rgba(22, 22, 21, 0.12);

  --yowo-fill-subtle: rgba(22, 22, 21, 0.035);
  --yowo-fill-hover: rgba(22, 22, 21, 0.06);
  --yowo-fill-selected: rgba(22, 22, 21, 0.10);

  color-scheme: light;
}

[data-theme="mono-black"],
[data-theme="dark"] {
  --yowo-bg: #0E0E0D;
  --yowo-bg-sunken: #090908;
  --yowo-surface: #171715;
  --yowo-surface-raised: #21201D;
  --yowo-fg: #EFECE4;
  --yowo-muted: #969086;
  --yowo-faint: #656058;
  --yowo-line: rgba(239, 236, 228, 0.09);
  --yowo-line-solid: #2B2A27;
  --yowo-border-strong: rgba(239, 236, 228, 0.22);
  --yowo-focus: #E47B52;

  --yowo-accent: #C9633A;
  --yowo-on-accent: #EDE8DC;
  --yowo-accent-strong: #E47B52;
  --yowo-on-accent-strong: #141210;
  --yowo-accent-soft: color-mix(in srgb, var(--yowo-accent) 11%, transparent);

  --yowo-status-success: #7FB596;
  --yowo-status-warning: #DCA542;
  --yowo-status-error: #E0705C;
  --yowo-status-running: #8FA3D6;
  --yowo-status-success-soft: color-mix(in srgb, var(--yowo-status-success) 13%, transparent);
  --yowo-status-warning-soft: color-mix(in srgb, var(--yowo-status-warning) 13%, transparent);
  --yowo-status-error-soft: color-mix(in srgb, var(--yowo-status-error) 13%, transparent);
  --yowo-status-running-soft: color-mix(in srgb, var(--yowo-status-running) 14%, transparent);

  --yowo-shadow-xs: inset 0 1px 0 rgba(239, 236, 228, 0.04), 0 1px 2px rgba(0, 0, 0, 0.32);
  --yowo-shadow-sm: inset 0 1px 0 rgba(239, 236, 228, 0.05), 0 4px 14px -2px rgba(0, 0, 0, 0.44);
  --yowo-shadow-md: inset 0 1px 0 rgba(239, 236, 228, 0.06), 0 10px 28px -4px rgba(0, 0, 0, 0.56);
  --yowo-shadow-float: 0 0 0 1px rgba(239, 236, 228, 0.09), inset 0 1px 0 rgba(239, 236, 228, 0.07), 0 20px 48px -8px rgba(0, 0, 0, 0.72);

  --yowo-fill-subtle: rgba(239, 236, 228, 0.04);
  --yowo-fill-hover: rgba(239, 236, 228, 0.075);
  --yowo-fill-selected: rgba(239, 236, 228, 0.12);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --yowo-bg: #0E0E0D;
    --yowo-bg-sunken: #090908;
    --yowo-surface: #171715;
    --yowo-surface-raised: #21201D;
    --yowo-fg: #EFECE4;
    --yowo-muted: #969086;
    --yowo-faint: #656058;
    --yowo-line: rgba(239, 236, 228, 0.09);
    --yowo-line-solid: #2B2A27;
    --yowo-border-strong: rgba(239, 236, 228, 0.22);
    --yowo-focus: #E47B52;

    --yowo-accent: #C9633A;
    --yowo-on-accent: #EDE8DC;
    --yowo-accent-strong: #E47B52;
    --yowo-on-accent-strong: #141210;
    --yowo-accent-soft: color-mix(in srgb, var(--yowo-accent) 11%, transparent);

    --yowo-status-success: #7FB596;
    --yowo-status-warning: #DCA542;
    --yowo-status-error: #E0705C;
    --yowo-status-running: #8FA3D6;
    --yowo-status-success-soft: color-mix(in srgb, var(--yowo-status-success) 13%, transparent);
    --yowo-status-warning-soft: color-mix(in srgb, var(--yowo-status-warning) 13%, transparent);
    --yowo-status-error-soft: color-mix(in srgb, var(--yowo-status-error) 13%, transparent);
    --yowo-status-running-soft: color-mix(in srgb, var(--yowo-status-running) 14%, transparent);

    --yowo-shadow-xs: inset 0 1px 0 rgba(239, 236, 228, 0.04), 0 1px 2px rgba(0, 0, 0, 0.32);
    --yowo-shadow-sm: inset 0 1px 0 rgba(239, 236, 228, 0.05), 0 4px 14px -2px rgba(0, 0, 0, 0.44);
    --yowo-shadow-md: inset 0 1px 0 rgba(239, 236, 228, 0.06), 0 10px 28px -4px rgba(0, 0, 0, 0.56);
    --yowo-shadow-float: 0 0 0 1px rgba(239, 236, 228, 0.09), inset 0 1px 0 rgba(239, 236, 228, 0.07), 0 20px 48px -8px rgba(0, 0, 0, 0.72);

    --yowo-fill-subtle: rgba(239, 236, 228, 0.04);
    --yowo-fill-hover: rgba(239, 236, 228, 0.075);
    --yowo-fill-selected: rgba(239, 236, 228, 0.12);

    color-scheme: dark;
  }
}

/* Poster / Editorial Backward-Compatible Palettes */
[data-theme="muted-orange"] {
  --yowo-bg: #C9633A;
  --yowo-bg-sunken: #BD5C35;
  --yowo-surface: #BD5C35;
  --yowo-surface-raised: #C9633A;
  --yowo-fg: #141414;
  --yowo-muted: #4E2412;
  --yowo-faint: #4E2412;
  --yowo-line: #B35532;
  --yowo-line-solid: #B35532;
  --yowo-border-strong: #4E2412;
  --yowo-focus: #141414;
  --yowo-accent: #EDE8DC;
  --yowo-on-accent: #C9633A;
  --yowo-accent-strong: #141414;
  --yowo-on-accent-strong: #EDE8DC;
  --yowo-accent-soft: color-mix(in srgb, var(--yowo-accent) 14%, transparent);
  --yowo-status-success: #2F6B4F;
  --yowo-status-warning: #8A5A0B;
  --yowo-status-error: #A8341F;
  --yowo-status-running: #26407F;
  --yowo-status-success-soft: color-mix(in srgb, var(--yowo-status-success) 10%, transparent);
  --yowo-status-warning-soft: color-mix(in srgb, var(--yowo-status-warning) 11%, transparent);
  --yowo-status-error-soft: color-mix(in srgb, var(--yowo-status-error) 10%, transparent);
  --yowo-status-running-soft: color-mix(in srgb, var(--yowo-status-running) 10%, transparent);
  --yowo-fill-subtle: rgba(20, 20, 20, 0.05);
  --yowo-fill-hover: rgba(20, 20, 20, 0.09);
  --yowo-fill-selected: rgba(20, 20, 20, 0.14);
  color-scheme: light;
}

[data-theme="bauhaus-blue"] {
  --yowo-bg: #26407F;
  --yowo-bg-sunken: #213872;
  --yowo-surface: #213872;
  --yowo-surface-raised: #3A538F;
  --yowo-fg: #EDE8DC;
  --yowo-muted: #A9B3CF;
  --yowo-faint: #A9B3CF;
  --yowo-line: #3A538F;
  --yowo-line-solid: #3A538F;
  --yowo-border-strong: #A9B3CF;
  --yowo-focus: #EDE8DC;
  --yowo-accent: #DFA23D;
  --yowo-on-accent: #26407F;
  --yowo-accent-strong: #DFA23D;
  --yowo-on-accent-strong: #141414;
  --yowo-accent-soft: color-mix(in srgb, var(--yowo-accent) 14%, transparent);
  --yowo-status-success: #7FB596;
  --yowo-status-warning: #DCA542;
  --yowo-status-error: #E0705C;
  --yowo-status-running: #8FA3D6;
  --yowo-status-success-soft: color-mix(in srgb, var(--yowo-status-success) 13%, transparent);
  --yowo-status-warning-soft: color-mix(in srgb, var(--yowo-status-warning) 13%, transparent);
  --yowo-status-error-soft: color-mix(in srgb, var(--yowo-status-error) 13%, transparent);
  --yowo-status-running-soft: color-mix(in srgb, var(--yowo-status-running) 14%, transparent);
  --yowo-fill-subtle: rgba(237, 232, 220, 0.05);
  --yowo-fill-hover: rgba(237, 232, 220, 0.09);
  --yowo-fill-selected: rgba(237, 232, 220, 0.14);
  color-scheme: dark;
}

[data-theme="ochre"] {
  --yowo-bg: #DCA542;
  --yowo-bg-sunken: #C4903A;
  --yowo-surface: #E4B55E;
  --yowo-surface-raised: #F6F2E9;
  --yowo-fg: #141414;
  --yowo-muted: #4F3A11;
  --yowo-faint: #4F3A11;
  --yowo-line: #C4903A;
  --yowo-line-solid: #C4903A;
  --yowo-border-strong: #4F3A11;
  --yowo-focus: #141414;
  --yowo-accent: #26407F;
  --yowo-on-accent: #EDE8DC;
  --yowo-accent-strong: #26407F;
  --yowo-on-accent-strong: #EDE8DC;
  --yowo-accent-soft: color-mix(in srgb, var(--yowo-accent) 11%, transparent);
  --yowo-status-success: #2F6B4F;
  --yowo-status-warning: #8A5A0B;
  --yowo-status-error: #A8341F;
  --yowo-status-running: #26407F;
  --yowo-status-success-soft: color-mix(in srgb, var(--yowo-status-success) 10%, transparent);
  --yowo-status-warning-soft: color-mix(in srgb, var(--yowo-status-warning) 11%, transparent);
  --yowo-status-error-soft: color-mix(in srgb, var(--yowo-status-error) 10%, transparent);
  --yowo-status-running-soft: color-mix(in srgb, var(--yowo-status-running) 10%, transparent);
  --yowo-fill-subtle: rgba(20, 20, 20, 0.05);
  --yowo-fill-hover: rgba(20, 20, 20, 0.09);
  --yowo-fill-selected: rgba(20, 20, 20, 0.14);
  color-scheme: light;
}

[data-theme="black-mountain"] {
  --yowo-bg: #27302E;
  --yowo-bg-sunken: #0E0E0D;
  --yowo-surface: #2F3936;
  --yowo-surface-raised: #3A4542;
  --yowo-fg: #EDE8DC;
  --yowo-muted: #97A09A;
  --yowo-faint: #97A09A;
  --yowo-line: #3A4542;
  --yowo-line-solid: #3A4542;
  --yowo-border-strong: #97A09A;
  --yowo-focus: #EDE8DC;
  --yowo-accent: #C9633A;
  --yowo-on-accent: #EDE8DC;
  --yowo-accent-strong: #E47B52;
  --yowo-on-accent-strong: #141210;
  --yowo-accent-soft: color-mix(in srgb, var(--yowo-accent) 12%, transparent);
  --yowo-status-success: #7FB596;
  --yowo-status-warning: #DCA542;
  --yowo-status-error: #E0705C;
  --yowo-status-running: #8FA3D6;
  --yowo-status-success-soft: color-mix(in srgb, var(--yowo-status-success) 13%, transparent);
  --yowo-status-warning-soft: color-mix(in srgb, var(--yowo-status-warning) 13%, transparent);
  --yowo-status-error-soft: color-mix(in srgb, var(--yowo-status-error) 13%, transparent);
  --yowo-status-running-soft: color-mix(in srgb, var(--yowo-status-running) 14%, transparent);
  --yowo-fill-subtle: rgba(237, 232, 220, 0.05);
  --yowo-fill-hover: rgba(237, 232, 220, 0.09);
  --yowo-fill-selected: rgba(237, 232, 220, 0.14);
  color-scheme: dark;
}

[data-theme] {
  background-color: var(--yowo-bg);
  color: var(--yowo-fg);
}

/* ----------------------------------------------------------------------------
 * 6. Component Tokens & 4 UI Variant Dials
 * -------------------------------------------------------------------------- */
:root,
[data-theme] {
  --yowo-component-button-primary-bg: var(--yowo-fg);
  --yowo-component-button-primary-fg: var(--yowo-bg);
  --yowo-component-button-secondary-border: var(--yowo-line-solid);
  --yowo-component-button-radius: var(--yowo-radius-sm);
  --yowo-component-button-height: 38px;
  --yowo-component-button-padding-x: var(--yowo-space-4);

  --yowo-component-input-bg: var(--yowo-surface);
  --yowo-component-input-border: var(--yowo-line-solid);
  --yowo-component-input-radius: var(--yowo-radius-sm);
  --yowo-component-input-height: var(--yowo-space-10);

  --yowo-component-card-bg: var(--yowo-surface);
  --yowo-component-card-border: var(--yowo-line);
  --yowo-component-card-radius: var(--yowo-radius-md);
  --yowo-component-card-padding: var(--yowo-space-6);
  --yowo-component-card-shadow: var(--yowo-shadow-xs);

  --yowo-component-capsule-radius: var(--yowo-radius-full);
  --yowo-component-chip-height: 22px;
  --yowo-component-chip-radius: var(--yowo-radius-xs);
  --yowo-component-composer-radius: var(--yowo-radius-lg);
  --yowo-component-popover-radius: var(--yowo-radius-md);
  --yowo-component-popover-shadow: var(--yowo-shadow-float);

  --yowo-component-yww-node-bg: var(--yowo-surface-raised);
  --yowo-component-yww-node-border: var(--yowo-line-solid);
  --yowo-component-yww-node-radius: var(--yowo-radius-md);
  --yowo-component-yww-node-header-label: var(--yowo-muted);
  --yowo-component-yww-node-port: var(--yowo-fg);
  --yowo-component-yww-node-width: 240px;

  --yowo-density-gap: var(--yowo-space-4);
  --yowo-density-panel-pad: var(--yowo-space-6);
  --yowo-surface-rail-bg: var(--yowo-bg-sunken);
  --yowo-surface-pane-bg: var(--yowo-bg);
  --yowo-surface-doc-bg: var(--yowo-surface-raised);
}

/* Variant 1: editorial-studio (YWS screenwriting & creative workspace default) */
[data-yowo-variant="editorial-studio"] {
  --yowo-component-button-radius: var(--yowo-radius-sm);
  --yowo-component-button-height: 38px;
  --yowo-component-button-padding-x: var(--yowo-space-4);
  --yowo-component-input-radius: var(--yowo-radius-sm);
  --yowo-component-input-height: var(--yowo-space-10);
  --yowo-component-card-bg: var(--yowo-surface);
  --yowo-component-card-border: var(--yowo-line);
  --yowo-component-card-radius: var(--yowo-radius-md);
  --yowo-component-card-padding: var(--yowo-space-6);
  --yowo-component-card-shadow: var(--yowo-shadow-xs);
  --yowo-component-capsule-radius: var(--yowo-radius-full);
  --yowo-component-chip-height: 22px;
  --yowo-component-chip-radius: var(--yowo-radius-xs);
  --yowo-component-composer-radius: var(--yowo-radius-lg);
  --yowo-component-popover-radius: var(--yowo-radius-md);
  --yowo-component-yww-node-radius: var(--yowo-radius-md);
  --yowo-density-gap: var(--yowo-space-4);
  --yowo-density-panel-pad: var(--yowo-space-6);
  --yowo-surface-rail-bg: var(--yowo-bg-sunken);
  --yowo-surface-pane-bg: var(--yowo-bg);
  --yowo-surface-doc-bg: var(--yowo-surface-raised);
}

/* Variant 2: canvas-workbench (YWW node canvas & directional spine) */
[data-yowo-variant="canvas-workbench"] {
  --yowo-component-button-radius: var(--yowo-radius-sm);
  --yowo-component-button-height: 34px;
  --yowo-component-button-padding-x: var(--yowo-space-3);
  --yowo-component-input-radius: var(--yowo-radius-sm);
  --yowo-component-input-height: 36px;
  --yowo-component-card-bg: var(--yowo-surface-raised);
  --yowo-component-card-border: var(--yowo-line-solid);
  --yowo-component-card-radius: 8px;
  --yowo-component-card-padding: var(--yowo-space-4);
  --yowo-component-card-shadow: var(--yowo-shadow-sm);
  --yowo-component-capsule-radius: var(--yowo-radius-full);
  --yowo-component-composer-radius: var(--yowo-radius-md);
  --yowo-component-popover-radius: var(--yowo-radius-md);
  --yowo-component-yww-node-bg: var(--yowo-surface-raised);
  --yowo-component-yww-node-border: var(--yowo-border-strong);
  --yowo-component-yww-node-radius: 8px;
  --yowo-density-gap: var(--yowo-space-3);
  --yowo-density-panel-pad: var(--yowo-space-4);
  --yowo-surface-rail-bg: var(--yowo-bg);
  --yowo-surface-pane-bg: var(--yowo-bg-sunken);
  --yowo-surface-doc-bg: var(--yowo-surface-raised);
}

/* Variant 3: ops-console (high-density telemetry, batch runs & operator tables) */
[data-yowo-variant="ops-console"] {
  --yowo-component-button-radius: var(--yowo-radius-xs);
  --yowo-component-button-height: var(--yowo-space-8);
  --yowo-component-button-padding-x: var(--yowo-space-3);
  --yowo-component-input-radius: var(--yowo-radius-xs);
  --yowo-component-input-height: var(--yowo-space-8);
  --yowo-component-card-bg: var(--yowo-surface);
  --yowo-component-card-border: var(--yowo-line-solid);
  --yowo-component-card-radius: var(--yowo-radius-sm);
  --yowo-component-card-padding: var(--yowo-space-4);
  --yowo-component-card-shadow: none;
  --yowo-component-capsule-radius: var(--yowo-radius-xs);
  --yowo-component-composer-radius: var(--yowo-radius-sm);
  --yowo-component-popover-radius: var(--yowo-radius-sm);
  --yowo-component-yww-node-radius: var(--yowo-radius-sm);
  --yowo-density-gap: var(--yowo-space-2);
  --yowo-density-panel-pad: var(--yowo-space-4);
  --yowo-surface-rail-bg: var(--yowo-bg-sunken);
  --yowo-surface-pane-bg: var(--yowo-bg);
  --yowo-surface-doc-bg: var(--yowo-surface);
}

/* Variant 4: cinema-stage (screening room, title cards & editorial hero) */
[data-yowo-variant="cinema-stage"] {
  --yowo-component-button-radius: var(--yowo-radius-xs);
  --yowo-component-button-height: 44px;
  --yowo-component-button-padding-x: var(--yowo-space-5);
  --yowo-component-input-radius: var(--yowo-radius-sm);
  --yowo-component-input-height: 44px;
  --yowo-component-card-bg: var(--yowo-surface-raised);
  --yowo-component-card-border: var(--yowo-line);
  --yowo-component-card-radius: var(--yowo-radius-md);
  --yowo-component-card-padding: var(--yowo-space-8);
  --yowo-component-card-shadow: var(--yowo-shadow-md);
  --yowo-component-capsule-radius: var(--yowo-radius-full);
  --yowo-component-chip-height: 22px;
  --yowo-component-chip-radius: var(--yowo-radius-xs);
  --yowo-component-composer-radius: var(--yowo-radius-lg);
  --yowo-component-popover-radius: var(--yowo-radius-md);
  --yowo-component-yww-node-radius: var(--yowo-radius-md);
  --yowo-density-gap: var(--yowo-space-5);
  --yowo-density-panel-pad: var(--yowo-space-8);
  --yowo-surface-rail-bg: var(--yowo-bg-sunken);
  --yowo-surface-pane-bg: var(--yowo-bg-sunken);
  --yowo-surface-doc-bg: var(--yowo-surface-raised);
}

/* ----------------------------------------------------------------------------
 * 7. Type Helper Classes (.yowo-type-*)
 * -------------------------------------------------------------------------- */
.yowo-type-display-xl {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-display-xl-size);
  line-height: var(--yowo-type-display-xl-line-height);
  letter-spacing: var(--yowo-type-display-xl-tracking);
  font-weight: var(--yowo-type-display-xl-weight);
}
.yowo-type-display-xl:lang(zh) { font-weight: 900; letter-spacing: 0; }

.yowo-type-display-l {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-display-l-size);
  line-height: var(--yowo-type-display-l-line-height);
  letter-spacing: var(--yowo-type-display-l-tracking);
  font-weight: var(--yowo-type-display-l-weight);
}
.yowo-type-display-l:lang(zh) { font-weight: 900; letter-spacing: 0; }

.yowo-type-display-m {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-display-m-size);
  line-height: var(--yowo-type-display-m-line-height);
  letter-spacing: var(--yowo-type-display-m-tracking);
  font-weight: var(--yowo-type-display-m-weight);
}
.yowo-type-display-m:lang(zh) { font-weight: 900; letter-spacing: 0; }

.yowo-type-title-l {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-title-l-size);
  line-height: var(--yowo-type-title-l-line-height);
  letter-spacing: var(--yowo-type-title-l-tracking);
  font-weight: var(--yowo-type-title-l-weight);
}
.yowo-type-title-l:lang(zh) { font-weight: 700; letter-spacing: 0; }

.yowo-type-title-m {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-title-m-size);
  line-height: var(--yowo-type-title-m-line-height);
  letter-spacing: var(--yowo-type-title-m-tracking);
  font-weight: var(--yowo-type-title-m-weight);
}
.yowo-type-title-m:lang(zh) { font-weight: 700; letter-spacing: 0; }

.yowo-type-title-s {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-title-s-size);
  line-height: var(--yowo-type-title-s-line-height);
  letter-spacing: var(--yowo-type-title-s-tracking);
  font-weight: var(--yowo-type-title-s-weight);
}
.yowo-type-title-s:lang(zh) { font-weight: 700; letter-spacing: 0; }

.yowo-type-heading-l {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-heading-l-size);
  line-height: var(--yowo-type-heading-l-line-height);
  letter-spacing: var(--yowo-type-heading-l-tracking);
  font-weight: var(--yowo-type-heading-l-weight);
}
.yowo-type-heading-l:lang(zh) { font-weight: 700; letter-spacing: 0; }

.yowo-type-heading-m {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-heading-m-size);
  line-height: var(--yowo-type-heading-m-line-height);
  letter-spacing: var(--yowo-type-heading-m-tracking);
  font-weight: var(--yowo-type-heading-m-weight);
}
.yowo-type-heading-m:lang(zh) { font-weight: 700; letter-spacing: 0; }

.yowo-type-heading-s {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-heading-s-size);
  line-height: var(--yowo-type-heading-s-line-height);
  letter-spacing: var(--yowo-type-heading-s-tracking);
  font-weight: var(--yowo-type-heading-s-weight);
}
.yowo-type-heading-s:lang(zh) { font-weight: 600; letter-spacing: 0; }

.yowo-type-heading-xs {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-heading-xs-size);
  line-height: var(--yowo-type-heading-xs-line-height);
  letter-spacing: var(--yowo-type-heading-xs-tracking);
  font-weight: var(--yowo-type-heading-xs-weight);
}
.yowo-type-heading-xs:lang(zh) { font-weight: 600; letter-spacing: 0; }

.yowo-type-reading {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-reading-size);
  line-height: var(--yowo-type-reading-line-height);
  letter-spacing: var(--yowo-type-reading-tracking);
  font-weight: var(--yowo-type-reading-weight);
}

.yowo-type-ui-md {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-md-size);
  line-height: var(--yowo-type-ui-md-line-height);
  letter-spacing: var(--yowo-type-ui-md-tracking);
  font-weight: var(--yowo-type-ui-md-weight);
}

.yowo-type-ui-base {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-base-size);
  line-height: var(--yowo-type-ui-base-line-height);
  letter-spacing: var(--yowo-type-ui-base-tracking);
  font-weight: var(--yowo-type-ui-base-weight);
}

.yowo-type-ui-sm {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-sm-size);
  line-height: var(--yowo-type-ui-sm-line-height);
  letter-spacing: var(--yowo-type-ui-sm-tracking);
  font-weight: var(--yowo-type-ui-sm-weight);
}

.yowo-type-label {
  font-family: var(--yowo-font-family-mono);
  font-size: var(--yowo-type-label-size);
  line-height: var(--yowo-type-label-line-height);
  letter-spacing: var(--yowo-type-label-tracking);
  font-weight: var(--yowo-type-label-weight);
  text-transform: uppercase;
  font-variation-settings: var(--yowo-font-mono-variation);
}
.yowo-type-label:lang(zh) { font-weight: 500; letter-spacing: 0.04em; }

.yowo-type-ui-2xs {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-2xs-size);
  line-height: var(--yowo-type-ui-2xs-line-height);
  letter-spacing: var(--yowo-type-ui-2xs-tracking);
  font-weight: var(--yowo-type-ui-2xs-weight);
}

/* v1 backward-compatible type helper classes */
.yowo-type-body {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-body-size);
  line-height: var(--yowo-type-body-line-height);
  letter-spacing: var(--yowo-type-body-tracking);
  font-weight: var(--yowo-type-body-weight);
}

.yowo-type-body-s {
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-body-s-size);
  line-height: var(--yowo-type-body-s-line-height);
  letter-spacing: var(--yowo-type-body-s-tracking);
  font-weight: var(--yowo-type-body-s-weight);
}

.yowo-type-label-s {
  font-family: var(--yowo-font-family-mono);
  font-size: var(--yowo-type-label-s-size);
  line-height: var(--yowo-type-label-s-line-height);
  letter-spacing: var(--yowo-type-label-s-tracking);
  font-weight: var(--yowo-type-label-s-weight);
  text-transform: uppercase;
  font-variation-settings: var(--yowo-font-mono-variation);
}
.yowo-type-label-s:lang(zh) { font-weight: 500; letter-spacing: 0.04em; }

/* ----------------------------------------------------------------------------
 * 8. .yw-* Component Primitives
 * -------------------------------------------------------------------------- */
.yw-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--yowo-space-2);
  min-height: var(--yowo-component-button-height);
  padding: 0 var(--yowo-component-button-padding-x);
  border: 1px solid var(--yowo-component-button-secondary-border);
  border-radius: var(--yowo-component-button-radius);
  background-color: var(--yowo-surface);
  color: var(--yowo-fg);
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-sm-size);
  font-weight: var(--yowo-font-weight-medium);
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: var(--yowo-shadow-xs);
  transition:
    background-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    border-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    box-shadow var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    transform 140ms var(--yowo-motion-ease-swing);
}

.yw-btn:hover:not(:disabled) {
  background-color: var(--yowo-fill-hover);
  border-color: var(--yowo-border-strong);
}

.yw-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  transition-duration: var(--yowo-motion-duration-press);
  transition-timing-function: var(--yowo-motion-ease-press);
}

.yw-btn:focus-visible {
  outline: 2px solid var(--yowo-focus);
  outline-offset: 2px;
}

.yw-btn:disabled,
.yw-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.yw-btn-primary {
  background-color: var(--yowo-component-button-primary-bg);
  color: var(--yowo-component-button-primary-fg);
  border-color: transparent;
  font-weight: var(--yowo-font-weight-semibold);
}

.yw-btn-primary:hover:not(:disabled) {
  background-color: color-mix(in srgb, var(--yowo-component-button-primary-bg) 86%, var(--yowo-component-button-primary-fg));
  border-color: transparent;
}

.yw-btn-accent {
  background-color: var(--yowo-accent-strong);
  color: var(--yowo-on-accent-strong);
  border-color: transparent;
  font-weight: var(--yowo-font-weight-semibold);
}

.yw-btn-accent:hover:not(:disabled) {
  background-color: color-mix(in srgb, var(--yowo-accent-strong) 88%, var(--yowo-fg));
  border-color: transparent;
}

.yw-btn-ghost {
  background-color: transparent;
  color: var(--yowo-muted);
  border-color: transparent;
  box-shadow: none;
}

.yw-btn-ghost:hover:not(:disabled) {
  background-color: var(--yowo-fill-hover);
  color: var(--yowo-fg);
  border-color: transparent;
}

/* ----------------------------------------------------------------------------
 * 8A. Read-Only Status Indicators (.yw-status & .yw-status-bracket — Style 3)
 * Zero pastel fills, zero borders: 17.76deg skewed ink bar + crisp fg text,
 * or screenplay continuity [ ● RUN ] bracket notation.
 * -------------------------------------------------------------------------- */
.yw-status {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--yowo-fg);
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-sm-size);
  font-weight: var(--yowo-font-weight-medium);
  line-height: 1.3;
  white-space: nowrap;
}

.yw-status::before {
  content: "";
  display: inline-block;
  width: 2.5px;
  height: 11px;
  background-color: var(--yw-status-ink, var(--yowo-faint));
  border-radius: var(--yowo-radius-none);
  transform: skewX(calc(var(--yowo-angle-slash) * -1));
  flex-shrink: 0;
}

.yw-status-accent  { --yw-status-ink: var(--yowo-accent-strong); }
.yw-status-success { --yw-status-ink: var(--yowo-status-success); }
.yw-status-warning { --yw-status-ink: var(--yowo-status-warning); }
.yw-status-error   { --yw-status-ink: var(--yowo-status-error); }
.yw-status-running { --yw-status-ink: var(--yowo-status-running); }

.yw-status-bracket {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--yowo-fg);
  font-family: var(--yowo-font-family-mono);
  font-variation-settings: var(--yowo-font-mono-variation);
  font-size: 11.5px;
  font-weight: var(--yowo-font-weight-medium);
  line-height: 1.3;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

@keyframes yw-status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.38; }
}

.yw-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--yowo-radius-full);
  background-color: var(--yowo-status-running);
  flex-shrink: 0;
}

.yw-status-dot.is-running {
  animation: yw-status-pulse 1.5s var(--yowo-motion-ease-standard) infinite;
}

/* ----------------------------------------------------------------------------
 * 8B. Interactive Context & Filter Chips (.yw-chip — Style 2)
 * Compact 22px height, neutral elevated surface (never colored pastel washes),
 * muted namespace prefix (.yw-chip-ns), and optional remove marker (.yw-chip-x).
 * -------------------------------------------------------------------------- */
.yw-chip {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: var(--yowo-component-chip-height);
  padding: 0 7px;
  border: 1px solid var(--yowo-line-solid);
  border-radius: var(--yowo-component-chip-radius);
  background-color: var(--yowo-surface-raised);
  color: var(--yowo-fg);
  font-family: var(--yowo-font-family-sans);
  font-size: 12px;
  font-weight: var(--yowo-font-weight-medium);
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    border-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    transform 140ms var(--yowo-motion-ease-swing);
}

.yw-chip-ns {
  color: var(--yowo-muted);
  font-weight: var(--yowo-font-weight-regular);
}

.yw-chip-x {
  color: var(--yowo-faint);
  font-size: 11px;
  line-height: 1;
  margin-left: 1px;
}

button.yw-chip,
a.yw-chip,
.yw-chip[role="button"] {
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
}

button.yw-chip[aria-pressed="false"] {
  background-color: transparent;
  color: var(--yowo-muted);
  border-color: var(--yowo-line-solid);
}

button.yw-chip:hover:not(:disabled),
a.yw-chip:hover,
.yw-chip[role="button"]:hover {
  border-color: var(--yowo-border-strong);
  background-color: var(--yowo-surface);
  color: var(--yowo-fg);
}

button.yw-chip:active:not(:disabled),
a.yw-chip:active,
.yw-chip[role="button"]:active {
  transform: scale(0.98);
  transition-duration: var(--yowo-motion-duration-press);
}

.yw-chip:focus-visible {
  outline: 2px solid var(--yowo-focus);
  outline-offset: 2px;
}

.yw-chip[aria-pressed="true"],
.yw-chip[aria-selected="true"],
.yw-chip.is-selected {
  background-color: var(--yowo-surface-raised);
  border-color: var(--yowo-accent-strong);
  color: var(--yowo-fg);
  font-weight: var(--yowo-font-weight-semibold);
}

.yw-input {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--yowo-component-input-height);
  padding: 0 var(--yowo-space-3);
  border: 1px solid var(--yowo-component-input-border);
  border-radius: var(--yowo-component-input-radius);
  background-color: var(--yowo-component-input-bg);
  color: var(--yowo-fg);
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-base-size);
  line-height: var(--yowo-type-ui-base-line-height);
  transition:
    border-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    background-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    box-shadow var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard);
}

textarea.yw-input {
  min-height: 88px;
  padding: 10px var(--yowo-space-3);
  resize: vertical;
}

.yw-input::placeholder {
  color: var(--yowo-faint);
}

.yw-input:hover:not(:disabled) {
  border-color: var(--yowo-border-strong);
}

.yw-input:focus,
.yw-input:focus-visible {
  outline: 2px solid transparent;
  border-color: var(--yowo-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--yowo-focus) 16%, transparent);
}

.yw-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.yw-composer {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--yowo-space-3) 14px;
  border: 1px solid var(--yowo-line-solid);
  border-radius: var(--yowo-component-composer-radius);
  background-color: var(--yowo-surface-raised);
  color: var(--yowo-fg);
  box-shadow: var(--yowo-shadow-sm);
  transition:
    border-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    box-shadow var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard);
}

.yw-composer:focus-within {
  border-color: var(--yowo-border-strong);
  box-shadow: var(--yowo-shadow-md), 0 0 0 3px var(--yowo-accent-soft);
}

.yw-composer textarea,
.yw-composer .yw-composer-input {
  box-sizing: border-box;
  width: 100%;
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: inherit;
  font-family: var(--yowo-font-family-sans);
  font-size: var(--yowo-type-ui-base-size);
  line-height: 1.6;
  resize: none;
  outline: none;
  box-shadow: none;
}

.yw-composer textarea::placeholder,
.yw-composer .yw-composer-input::placeholder {
  color: var(--yowo-faint);
}

/* Integrated compound tray inside .yw-composer (OptionsDock / QuestionDock / batch bar).
 * Attaches inside the same depth=1 composer shell instead of stacking a second card above it. */
.yw-composer-tray {
  box-sizing: border-box;
  margin: -2px -14px 2px;
  padding: 2px 14px 10px;
  border-bottom: 1px solid var(--yowo-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* .yw-card is strictly a LEAF container (depth = 1 max) for standalone items such as
 * sparse project shelf tiles. NEVER use .yw-card as a pane wrapper, and NEVER nest
 * inside another .yw-card, .yw-composer, or .yw-popover. */
.yw-card {
  box-sizing: border-box;
  background-color: var(--yowo-component-card-bg);
  color: var(--yowo-fg);
  border: 1px solid var(--yowo-component-card-border);
  border-radius: var(--yowo-component-card-radius);
  padding: var(--yowo-component-card-padding);
  box-shadow: var(--yowo-component-card-shadow);
  transition:
    border-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    box-shadow var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard),
    background-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard);
}

a.yw-card,
button.yw-card,
.yw-card-interactive {
  cursor: pointer;
  text-decoration: none;
}

a.yw-card:hover,
button.yw-card:hover,
.yw-card-interactive:hover {
  border-color: var(--yowo-border-strong);
  box-shadow: var(--yowo-shadow-sm);
}

a.yw-card:focus-visible,
button.yw-card:focus-visible,
.yw-card-interactive:focus-visible {
  outline: 2px solid var(--yowo-focus);
  outline-offset: 2px;
}

.yw-popover {
  box-sizing: border-box;
  background-color: var(--yowo-surface-raised);
  color: var(--yowo-fg);
  border: 1px solid var(--yowo-line-solid);
  border-radius: var(--yowo-component-popover-radius);
  box-shadow: var(--yowo-component-popover-shadow);
  padding: 6px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity var(--yowo-motion-duration-fast) var(--yowo-motion-ease-swing),
    transform var(--yowo-motion-duration-fast) var(--yowo-motion-ease-swing),
    display var(--yowo-motion-duration-fast) allow-discrete,
    overlay var(--yowo-motion-duration-fast) allow-discrete;
}

.yw-popover[popover]:not(:popover-open),
dialog.yw-popover:not([open]) {
  opacity: 0;
  transform: translateY(4px) scale(0.98);
}

@starting-style {
  .yw-popover:popover-open,
  dialog.yw-popover[open],
  .yw-popover[data-open="true"],
  .yw-popover.is-open {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}

.yw-slash-accent {
  display: inline-block;
  width: 5px;
  height: 28px;
  min-height: 24px;
  background-color: var(--yowo-accent);
  border-radius: var(--yowo-radius-none);
  transform: skewX(calc(var(--yowo-angle-slash) * -1));
  flex-shrink: 0;
}

/* Open-Plane Inline Diff (zero outer card, zero nested boxes) */
.yw-diff-inline {
  box-sizing: border-box;
  margin: var(--yowo-space-5) 0;
  padding: 2px 0 2px var(--yowo-space-4);
  border-left: 2px solid var(--yowo-border-strong);
  border-radius: var(--yowo-radius-none);
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: var(--yowo-space-2);
}

.yw-diff-del {
  margin: 0;
  color: var(--yowo-muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--yowo-status-error) 68%, transparent);
}

.yw-diff-ins {
  margin: 0;
  padding: 2px 6px;
  border-radius: var(--yowo-radius-xs);
  background-color: var(--yowo-status-success-soft);
  color: var(--yowo-fg);
}

.yw-diff-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--yowo-space-2) var(--yowo-space-4);
  padding-top: var(--yowo-space-1);
}

/* Open-Plane Horizontal Metric Strip (zero outer card box) */
.yw-kpi-strip {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-top: 1px solid var(--yowo-line);
  border-bottom: 1px solid var(--yowo-line);
  background: transparent;
  border-radius: var(--yowo-radius-none);
}

.yw-kpi-strip > * {
  min-width: 0;
  padding: var(--yowo-space-4) var(--yowo-space-5);
}

.yw-kpi-strip > * + * {
  border-left: 1px solid var(--yowo-line);
}

/* Open-Plane Cardless Data Table (horizontal hairlines only, no wrapper box) */
.yw-table-flush {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-size: var(--yowo-type-ui-sm-size);
}

.yw-table-flush th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--yowo-line-solid);
  font-family: var(--yowo-font-family-mono);
  font-variation-settings: var(--yowo-font-mono-variation);
  font-size: var(--yowo-type-ui-2xs-size);
  font-weight: var(--yowo-font-weight-semibold);
  color: var(--yowo-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.yw-table-flush td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--yowo-line);
  vertical-align: middle;
  white-space: nowrap;
}

.yw-table-flush tbody tr {
  cursor: pointer;
  transition: background-color var(--yowo-motion-duration-fast) var(--yowo-motion-ease-standard);
}

.yw-table-flush tbody tr:hover {
  background-color: var(--yowo-fill-hover);
}

.yw-table-flush tbody tr[aria-selected="true"] {
  background-color: var(--yowo-fill-selected);
}

/* ----------------------------------------------------------------------------
 * 8C. Deprecated Compatibility Rules (.yw-capsule* -> clean neutral/slash look)
 * Prefer .yw-status / .yw-status-bracket for read-only statuses and .yw-chip for
 * interactive context/filter tokens. Retained solely so legacy callers do not break.
 * -------------------------------------------------------------------------- */
.yw-capsule {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--yowo-component-chip-height);
  padding: 0 7px;
  border: 1px solid var(--yowo-line-solid);
  border-radius: var(--yowo-component-chip-radius);
  background-color: var(--yowo-surface-raised);
  color: var(--yowo-fg);
  font-family: var(--yowo-font-family-sans);
  font-size: 12px;
  font-weight: var(--yowo-font-weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.yw-capsule-accent,
.yw-capsule-success,
.yw-capsule-warning,
.yw-capsule-error,
.yw-capsule-running {
  border: 0;
  padding: 0;
  height: auto;
  background: transparent;
  color: var(--yowo-fg);
}

.yw-capsule-accent::before,
.yw-capsule-success::before,
.yw-capsule-warning::before,
.yw-capsule-error::before,
.yw-capsule-running::before {
  content: "";
  display: inline-block;
  width: 2.5px;
  height: 11px;
  transform: skewX(calc(var(--yowo-angle-slash) * -1));
  flex-shrink: 0;
}
.yw-capsule-accent::before  { background-color: var(--yowo-accent-strong); }
.yw-capsule-success::before { background-color: var(--yowo-status-success); }
.yw-capsule-warning::before { background-color: var(--yowo-status-warning); }
.yw-capsule-error::before   { background-color: var(--yowo-status-error); }
.yw-capsule-running::before { background-color: var(--yowo-status-running); }

/* ----------------------------------------------------------------------------
 * 9. Reduced Motion Override
 * -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :root,
  [data-theme],
  [data-yowo-variant] {
    --yowo-motion-duration-press: 0ms;
    --yowo-motion-duration-fast: 0ms;
    --yowo-motion-duration-base: 0ms;
    --yowo-motion-duration-slow: 0ms;
  }

  .yw-btn,
  .yw-chip,
  .yw-capsule,
  .yw-input,
  .yw-composer,
  .yw-card,
  .yw-popover,
  .yw-table-flush tbody tr {
    transition: none;
  }

  .yw-status-dot.is-running {
    animation: none;
  }

  .yw-btn:active:not(:disabled),
  button.yw-chip:active:not(:disabled),
  a.yw-chip:active,
  .yw-chip[role="button"]:active,
  .yw-popover[popover]:not(:popover-open),
  dialog.yw-popover:not([open]) {
    transform: none;
  }

  @starting-style {
    .yw-popover:popover-open,
    dialog.yw-popover[open],
    .yw-popover[data-open="true"],
    .yw-popover.is-open {
      transform: none;
    }
  }
}
