/**
 * AI nomination diagnostics (Errors, Logs & Revisions).
 */
.nomination-ai-log__json,
.nomination-ai-log__body {
  max-height: 24rem;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text-primary);
  font: 0.8125rem/1.55 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.nomination-ai-log__body { max-height: 18rem; }

#nominationAiLogInsights { margin-bottom: 1rem; }

#nominationAiLogPagination {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
}

#nominationAiLogPagination:not([hidden]) { display: flex; }

[data-theme="dark"] .nomination-ai-log__json,
[data-theme="dark"] .nomination-ai-log__body {
  background: var(--surface-muted);
  border-color: var(--border-color);
}

/**
 * Shared design tokens
 * Light-mode canonical tokens in parser-friendly standard structure.
 *
 * Notes:
 * - Added numeric tokens use direct values, e.g. --radius-12: 12px.
 * - Component HTML should reference these canonical token names.
 */

/* @light-only */
/* @group-priority: radius, spacers, font, body, heading, code, bg, bg-brand, text, icon, border, accent, status, brand */

:root {
  /* radius */
  --radius-0: 0px;
  --radius-2: 2px;
  --radius-4: 4px;
  --radius-6: 6px;
  --radius-8: 8px;
  --radius-10: 10px;
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-20: 20px;
  --radius-24: 24px;
  --radius-32: 32px;
  --radius-full: 999px;
  --radius-xs: var(--radius-2);
  --radius-sm: var(--radius-4);
  --radius-md: var(--radius-6);
  --radius-lg: var(--radius-8);
  --radius-xl: var(--radius-10);
  --border-width-default: 1px;

  /* spacers */
  --spacer-0: 0px;
  --spacer-2: 2px;
  --spacer-3: 3px;
  --spacer-4: 4px;
  --spacer-6: 6px;
  --spacer-8: 8px;
  --spacer-10: 10px;
  --spacer-12: 12px;
  --spacer-16: 16px;
  --spacer-20: 20px;
  --spacer-24: 24px;
  --spacer-32: 32px;
  --spacer-40: 40px;
  --spacer-48: 48px;
  --spacer-64: 64px;

  /* toolbar */
  --toolbar-control-height: 40px;

  /* icon sizes */
  --icon-size-12: 12px;
  --icon-size-14: 14px;
  --icon-size-16: 16px;
  --icon-size-20: 20px;
  --icon-size-24: 24px;

  /* font */
  --font-family-default: "SF Pro Text", "PingFang SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-family-heading: "SF Pro", "PingFang SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-family-metric: "Inter", "SF Pro Text", "PingFang SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-weight-default: 400;
  --font-weight-code: 450;
  --font-weight-medium: 500;
  --font-weight-strong: 600;
  --font-family-base: var(--font-family-default);
  --font-family-heading-alias: var(--font-family-heading);
  --font-family-mono-alias: var(--font-family-mono);

  /* body */
  --body-xs-font-family: var(--font-family-default);
  --body-xs-font-size: 10px;
  --body-xs-font-weight: 400;
  --body-xs-line-height: 14px;
  --body-xs-letter-spacing: 0;
  --body-xs-strong-font-family: var(--font-family-default);
  --body-xs-strong-font-size: 10px;
  --body-xs-strong-font-weight: 500;
  --body-xs-strong-line-height: 14px;
  --body-xs-strong-letter-spacing: 0;
  --body-sm-font-family: var(--font-family-default);
  --body-sm-font-size: 11px;
  --body-sm-font-weight: 400;
  --body-sm-line-height: 16px;
  --body-sm-letter-spacing: 0;
  --body-sm-strong-font-family: var(--font-family-default);
  --body-sm-strong-font-size: 11px;
  --body-sm-strong-font-weight: 500;
  --body-sm-strong-line-height: 16px;
  --body-sm-strong-letter-spacing: 0;
  --body-md-font-family: var(--font-family-default);
  --body-md-font-size: 12px;
  --body-md-font-weight: 400;
  --body-md-line-height: 18px;
  --body-md-letter-spacing: 0;
  --body-md-strong-font-family: var(--font-family-default);
  --body-md-strong-font-size: 12px;
  --body-md-strong-font-weight: 500;
  --body-md-strong-line-height: 18px;
  --body-md-strong-letter-spacing: 0;
  --body-base-font-family: var(--font-family-default);
  --body-base-font-size: 14px;
  --body-base-font-weight: 400;
  --body-base-line-height: 20px;
  --body-base-letter-spacing: -0.02em;
  --body-base-strong-font-family: var(--font-family-default);
  --body-base-strong-font-size: 14px;
  --body-base-strong-font-weight: 500;
  --body-base-strong-line-height: 20px;
  --body-base-strong-letter-spacing: -0.02em;
  --body-lg-font-family: var(--font-family-default);
  --body-lg-font-size: 18px;
  --body-lg-font-weight: 400;
  --body-lg-line-height: 28px;
  --body-lg-letter-spacing: -0.02em;

  /* heading */
  --heading-3xs-font-family: var(--font-family-default);
  --heading-3xs-font-size: 11px;
  --heading-3xs-font-weight: 600;
  --heading-3xs-line-height: 16px;
  --heading-3xs-letter-spacing: 0;
  --heading-2xs-font-family: var(--font-family-default);
  --heading-2xs-font-size: 12px;
  --heading-2xs-font-weight: 600;
  --heading-2xs-line-height: 18px;
  --heading-2xs-letter-spacing: 0;
  --heading-xs-font-family: var(--font-family-default);
  --heading-xs-font-size: 13px;
  --heading-xs-font-weight: 600;
  --heading-xs-line-height: 20px;
  --heading-xs-letter-spacing: 0;
  --heading-sm-font-family: var(--font-family-default);
  --heading-sm-font-size: 16px;
  --heading-sm-font-weight: 600;
  --heading-sm-line-height: 24px;
  --heading-sm-letter-spacing: 0;
  --heading-md-font-family: var(--font-family-heading);
  --heading-md-font-size: 20px;
  --heading-md-font-weight: 600;
  --heading-md-line-height: 28px;
  --heading-md-letter-spacing: 0;
  --heading-lg-font-family: var(--font-family-heading);
  --heading-lg-font-size: 22px;
  --heading-lg-font-weight: 600;
  --heading-lg-line-height: 30px;
  --heading-lg-letter-spacing: 0;
  --heading-xl-font-family: var(--font-family-heading);
  --heading-xl-font-size: 24px;
  --heading-xl-font-weight: 600;
  --heading-xl-line-height: 32px;
  --heading-xl-letter-spacing: 0;
  --heading-2xl-font-family: var(--font-family-heading);
  --heading-2xl-font-size: 28px;
  --heading-2xl-font-weight: 600;
  --heading-2xl-line-height: 36px;
  --heading-2xl-letter-spacing: 0;
  --heading-3xl-font-family: var(--font-family-heading);
  --heading-3xl-font-size: 32px;
  --heading-3xl-font-weight: 600;
  --heading-3xl-line-height: 40px;
  --heading-3xl-letter-spacing: 0;
  --heading-display-font-family: var(--font-family-heading);
  --heading-display-font-size: 52px;
  --heading-display-font-weight: 600;
  --heading-display-line-height: 60px;
  --heading-display-letter-spacing: -0.03em;
  --heading-display-sm-font-family: var(--font-family-heading);
  --heading-display-sm-font-size: 40px;
  --heading-display-sm-font-weight: 600;
  --heading-display-sm-line-height: 48px;
  --heading-display-sm-letter-spacing: -0.02em;

  /* code */
  --code-editor-font-family: var(--font-family-mono);
  --code-editor-font-size: 13px;
  --code-editor-font-weight: 450;
  --code-editor-line-height: 20px;
  --code-terminal-font-family: var(--font-family-mono);
  --code-terminal-font-size: 12px;
  --code-terminal-font-weight: 450;
  --code-terminal-line-height: 18px;
  --code-text: #17181A;
  --code-doc: #8393A3;
  --code-link: #2F74FF;
  --code-number: #E54595;
  --code-action: #5F36B2;
  --code-instruction: #B15EF2;
  --code-function: #FF5D4D;
  --code-constant: #175CE6;
  --code-parameter: #4DA621;
  --code-attribute: #C99100;
  --code-tag: #E24864;

  /* bg */
  --bg-base-default: #FFFFFF;
  --bg-base-secondary: #F5F5F5;
  --bg-base-tertiary: #E5E5E5;
  --bg-overlay-l1: rgba(115, 115, 115, 0.08);
  --bg-overlay-l2: rgba(115, 115, 115, 0.12);
  --bg-overlay-l3: rgba(115, 115, 115, 0.16);
  --bg-overlay-l4: rgba(115, 115, 115, 0.20);
  --bg-white: #FFFFFF;
  --bg-menu: #FFFFFF;
  --bg-tooltip: #FFFFFF;
  --bg-invert: #262626;
  --bg-invert-hover: #404040;
  --bg-invert-active: #171717;
  --bg-invert-disabled: rgba(115, 115, 115, 0.20);
  --color-background: var(--bg-base-default);
  --color-surface: var(--bg-base-secondary);
  --color-surface-variant: var(--bg-base-tertiary);
  --color-overlay-1: var(--bg-overlay-l1);
  --color-overlay-2: var(--bg-overlay-l2);
  --color-overlay-3: var(--bg-overlay-l3);
  --color-overlay-4: var(--bg-overlay-l4);
  --color-card: var(--bg-base-secondary);
  --color-tooltip: var(--bg-tooltip);
  --color-menu: var(--bg-menu);

  /* bg-brand */
  --bg-brand: #4B3FE3;
  --bg-brand-hover: #6A6FFF;
  --bg-brand-active: #3F31C6;
  --bg-brand-disabled: rgba(75, 63, 227, 0.22);
  --bg-brand-popup: rgba(170, 183, 255, 0.36);
  --color-primary: var(--bg-brand);
  --color-primary-hover: var(--bg-brand-hover);
  --color-primary-disabled: var(--bg-brand-disabled);
  --color-primary-soft: var(--bg-brand-popup);
  --color-accent: var(--bg-brand);

  /* text */
  --text-default: #171717;
  --text-default-hover: #262626;
  --text-default-active: #262626;
  --text-secondary: #404040;
  --text-secondary-hover: #171717;
  --text-secondary-active: #171717;
  --text-tertiary: #737373;
  --text-disabled: #A1A1A1;
  --text-onbrand: #FFFFFF;
  --text-onaccent: #FFFFFF;
  --text-white: #FFFFFF;
  --color-foreground: var(--text-default);
  --color-foreground-hover: var(--text-default-hover);
  --color-on-surface: var(--text-default);
  --color-on-surface-variant: var(--text-secondary);
  --color-muted-foreground: var(--text-secondary);
  --color-disabled-foreground: var(--text-disabled);
  --color-on-primary: var(--text-onbrand);
  --text-brand: #4B3FE3;
  --text-brand-hover: #6A6FFF;

  /* icon */
  --icon-default: #262626;
  --icon-default-hover: #171717;
  --icon-default-active: #171717;
  --icon-secondary: #404040;
  --icon-secondary-hover: #262626;
  --icon-secondary-active: #262626;
  --icon-tertiary: #737373;
  --icon-disabled: #A1A1A1;
  --icon-onbrand: #FFFFFF;
  --icon-onaccent: #FFFFFF;
  --icon-white: #FFFFFF;
  --icon-brand: #4B3FE3;
  --icon-brand-hover: #6A6FFF;

  /* border */
  --border-neutral-l1: rgba(115, 115, 115, 0.12);
  --border-neutral-l2: rgba(115, 115, 115, 0.18);
  --border-neutral-l3: rgba(115, 115, 115, 0.36);
  --border-contrast: #000000;
  --border-brand: #4B3FE3;
  --color-border: var(--border-neutral-l1);
  --color-border-strong: var(--border-neutral-l2);
  --color-border-stronger: var(--border-neutral-l3);
  --color-border-contrast: var(--border-contrast);
  --color-outline: var(--border-neutral-l1);

  /* accent */
  --accent-teal: #00B983;
  --accent-coral: #FF6B45;
  --accent-amber: #F2A90C;
  --accent-lime: #5FC000;
  --accent-cyan: #00B6F5;
  --accent-blue: #3F85FF;
  --accent-magenta: #F53CFF;
  --accent-violet: #9570FF;
  --accent-slate: #747E94;

  /* status */
  --status-primary-default: #2F74FF;
  --status-primary-hover: #4C88FF;
  --status-primary-active: #1759DD;
  --status-primary-surface-l1: rgba(47, 116, 255, 0.12);
  --status-primary-surface-l2: rgba(47, 116, 255, 0.18);
  --status-primary-surface-l3: rgba(47, 116, 255, 0.36);
  --status-success-default: #15A877;
  --status-success-hover: #2FB287;
  --status-success-active: #1E8B56;
  --status-success-surface-l1: rgba(64, 176, 139, 0.12);
  --status-success-surface-l2: rgba(64, 176, 139, 0.18);
  --status-success-surface-l3: rgba(64, 176, 139, 0.36);
  --status-alert-default: #FEA900;
  --status-alert-hover: #FFB700;
  --status-alert-active: #E59100;
  --status-alert-surface-l1: rgba(254, 169, 0, 0.14);
  --status-alert-surface-l2: rgba(254, 169, 0, 0.20);
  --status-alert-surface-l3: rgba(254, 169, 0, 0.36);
  --status-warning-default: #E27900;
  --status-warning-hover: #F39A35;
  --status-warning-active: #C46F11;
  --status-warning-surface-l1: rgba(226, 121, 0, 0.12);
  --status-warning-surface-l2: rgba(226, 121, 0, 0.16);
  --status-warning-surface-l3: rgba(226, 121, 0, 0.36);
  --status-error-default: #E8463A;
  --status-error-hover: #EA574C;
  --status-error-active: #C9382F;
  --status-error-surface-l1: rgba(232, 70, 58, 0.12);
  --status-error-surface-l2: rgba(232, 70, 58, 0.16);
  --status-error-surface-l3: rgba(232, 70, 58, 0.36);
  --color-info: var(--status-primary-default);
  --color-success: var(--status-success-default);
  --color-warning: var(--status-warning-default);
  --color-error: var(--status-error-default);
  --color-error-soft: var(--status-error-surface-l1);

  /* brand */
  --brand-50: #F2F7FF;
  --brand-100: #E5EAFF;
  --brand-200: #CFD8FF;
  --brand-300: #AAB7FF;
  --brand-400: #8894FF;
  --brand-500: #6A6FFF;
  --brand-600: #4B3FE3;
  --brand-700: #3F31C6;
  --brand-800: #2C2290;
  --brand-900: #1A1759;
  --brand-950: #010109;
  --brand-grey-50: #FAFAFA;
  --brand-grey-100: #F5F5F5;
  --brand-grey-200: #E5E5E5;
  --brand-grey-300: #D4D4D4;
  --brand-grey-400: #A1A1A1;
  --brand-grey-500: #737373;
  --brand-grey-600: #525252;
  --brand-grey-700: #404040;
  --brand-grey-800: #262626;
  --brand-grey-900: #171717;
  --brand-grey-950: #0A0A0A;
  --brand-green-100: var(--brand-50);
  --brand-green-200: var(--brand-100);
  --brand-green-300: var(--brand-200);
  --brand-green-400: var(--brand-300);
  --brand-green-500: var(--brand-600);
  --brand-green-600: var(--brand-500);
  --brand-green-700: var(--brand-700);
  --brand-green-800: var(--brand-800);
  --brand-green-900: var(--brand-900);
  --brand-green-1000: var(--brand-950);
  --brand-red-100: #FFE5E5;
  --brand-red-200: #FFCCCC;
  --brand-red-300: #FFB2B2;
  --brand-red-400: #FF9999;
  --brand-red-500: #FF8080;
  --brand-red-600: #FF6464;
  --brand-red-700: #E63737;
  --brand-red-800: #CB1010;
  --brand-red-900: #8F0505;
  --brand-red-1000: #4D0000;
  --brand-yellow-100: #FFF6E5;
  --brand-yellow-200: #FFECCC;
  --brand-yellow-300: #FFE3B2;
  --brand-yellow-400: #FFDA99;
  --brand-yellow-500: #FFD080;
  --brand-yellow-600: #FFC864;
  --brand-yellow-700: #E6A637;
  --brand-yellow-800: #CB8710;
  --brand-yellow-900: #8F5C05;
  --brand-yellow-1000: #4D3000;
  --brand-blue-100: #E5F3FF;
  --brand-blue-200: #CCE6FF;
  --brand-blue-300: #B2DAFF;
  --brand-blue-400: #99CEFF;
  --brand-blue-500: #80C1FF;
  --brand-blue-600: #64B4FF;
  --brand-blue-700: #3792E6;
  --brand-blue-800: #1071CB;
  --brand-blue-900: #054C8F;
  --brand-blue-1000: #00284D;
  --brand-purple-100: #E8E5FF;
  --brand-purple-200: #D2CCFF;
  --brand-purple-300: #BBB2FF;
  --brand-purple-400: #A599FF;
  --brand-purple-500: #8E80FF;
  --brand-purple-600: #7864FF;
  --brand-purple-700: #4C37E6;
  --brand-purple-800: #2610CB;
  --brand-purple-900: #15058F;
  --brand-purple-1000: #09004D;
  --brand-neutral-grey-100: #F2F2F2;
  --brand-neutral-grey-200: #E3E3E3;
  --brand-neutral-grey-300: #D6D6D6;
  --brand-neutral-grey-400: #C7C7C7;
  --brand-neutral-grey-500: #BABABA;
  --brand-neutral-grey-600: #ABABAB;
  --brand-neutral-grey-700: #8A8A8A;
  --brand-neutral-grey-800: #686868;
  --brand-neutral-grey-900: #474747;
  --brand-neutral-grey-1000: #262626;
  --brand-blue-grey-100: #F1EFF4;
  --brand-blue-grey-200: #E0E1E6;
  --brand-blue-grey-300: #CFD3D8;
  --brand-blue-grey-400: #BFC5CA;
  --brand-blue-grey-500: #B0B5BA;
  --brand-blue-grey-600: #A0A6AB;
  --brand-blue-grey-700: #80898E;
  --brand-blue-grey-800: #5E696E;
  --brand-blue-grey-900: #404A4F;
  --brand-blue-grey-1000: #21262B;
  --brand-green-grey-100: #F1F4F4;
  --brand-green-grey-200: #E0E6E6;
  --brand-green-grey-300: #CFD8D8;
  --brand-green-grey-400: #BFCACA;
  --brand-green-grey-500: #B0BABA;
  --brand-green-grey-600: #A0ABAB;
  --brand-green-grey-700: #808E8E;
  --brand-green-grey-800: #5E6E6E;
  --brand-green-grey-900: #404F4F;
  --brand-green-grey-1000: #212B2B;

  /* generic fallback */
  --font-family: var(--font-family-default);
  --font-size: var(--body-xs-font-size);
  --font-weight: var(--body-xs-font-weight);
  --line-height: var(--body-xs-line-height);

  /* viz */
  --viz-series-brand: var(--bg-brand);
  --viz-series-brand-soft: var(--brand-300);
  --viz-series-brand-mid: var(--brand-500);
  --viz-series-brand-deep: var(--brand-700);
  --viz-series-neutral: var(--brand-grey-500);
  --viz-series-coral: #F87454;
  --viz-series-amber: #EDAA45;
  --viz-series-mint: #1DC981;
  --viz-series-teal: #59E8E8;
  --viz-series-sky: #22A5F7;
  --viz-series-violet: #B655FC;
  --viz-series-magenta: #FB9DD7;
  --viz-series-indigo: #B6A3FF;
  --viz-series-lime: #A6EA39;
  --viz-series-slate: #859EAD;
  --viz-ui-bg-chart: var(--bg-menu);
  --viz-ui-bg-tooltip: var(--bg-tooltip);
  --viz-ui-chart-title: var(--text-default);
  --viz-ui-chart-subtitle: var(--text-secondary);
  --viz-ui-chart-axis: var(--border-neutral-l2);
  --viz-ui-chart-tick: var(--text-secondary);
  --viz-ui-legend-label: var(--text-secondary);
  --viz-ui-legend-value: var(--text-default);

  /* special */
  --special-white: #FFFFFF;
  --special-black: #000000;
  --special-bgtabsoverlay: rgba(255, 255, 255, 0.12);
  --special-bggoldoverlay: rgba(210, 181, 19, 0.12);

  /* layout aliases */
  --brand-1: var(--brand-600);
  --brand-2: var(--brand-500);
  --brand-3: var(--brand-300);
  --brand-4: var(--brand-100);
  --site-canvas: var(--bg-base-default);
  --bg-layout-1: var(--bg-base-secondary);
  --bg-layout-2: var(--bg-overlay-l1);
  --border-1: var(--border-neutral-l1);

  /* shell stacking */
  --notification-drawer-width: 420px;
  --shell-z-sidebar: 1000;
  --shell-z-sheet: 1060;
  --shell-z-fab: 1080;
  --shell-z-modal: 1100;
  --shell-z-toast: 1110;
  --shell-z-picker: 1120;
  --shell-z-banner: 2100;
  --toast-z-index: var(--shell-z-toast);
  --toast-offset-top: calc(var(--space-12) * 2 + var(--toolbar-control-height) + var(--space-16));
  --toast-offset-right: var(--space-16);
  --toast-offset-left: auto;
  --desktop-asset-cache-refresh-offset-right: var(--space-16);
}

/* Shared component styles */

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   components.css â€” Design System Component Definitions
   Auto-extracted from preview/component-*.html
   DO NOT EDIT MANUALLY â€” regenerate via extract-components-css.mjs
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Alert â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Notification / Toast ===== */
    .ds-notif {
      display: flex; align-items: flex-start;
      gap: var(--spacer-8);
      width: 100%; max-width: 560px;
      padding: var(--spacer-8) var(--spacer-12);
      border: 1px solid var(--border-neutral-l1);
      background: var(--bg-base-secondary);
      border-radius: var(--radius-8);
      color: var(--text-default);
      font-family: var(--body-md-font-family);
      font-size: var(--body-md-font-size);
      line-height: var(--body-md-line-height);
      letter-spacing: var(--body-md-letter-spacing);
      box-shadow: none;
    }
    .ds-notif__icon { flex: 0 0 16px; width: 16px; height: 16px; margin-top: var(--spacer-2); color: var(--icon-default); display: inline-flex; align-items: center; justify-content: center; }
    .ds-notif__body { flex: 1; min-width: 0; }
    .ds-notif__title { font-family: var(--body-md-strong-font-family); font-size: var(--body-md-strong-font-size); line-height: var(--body-md-strong-line-height); font-weight: var(--body-md-strong-font-weight); letter-spacing: var(--body-md-strong-letter-spacing); color: var(--text-default); }
    .ds-notif__text { flex: 1; color: var(--text-default); }
    .ds-notif__desc { margin-top: var(--spacer-2); color: var(--text-secondary); font-size: var(--body-md-font-size); line-height: var(--body-md-line-height); }
    .ds-notif__actions { display: inline-flex; align-items: center; gap: var(--spacer-8); margin-top: var(--spacer-8); }
    .ds-notif__close { flex-shrink: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; cursor: pointer; color: var(--icon-secondary); border-radius: var(--radius-8); }
    .ds-notif__close .icon { width: 14px; height: 14px; }
    .ds-notif__close:hover { background: var(--bg-overlay-l2); color: var(--icon-default); }
    .ds-notif--simple { align-items: center; }
    .ds-notif--error { background: var(--status-error-surface-l1); border-color: var(--status-error-surface-l2); }
    .ds-notif--error .ds-notif__icon { color: var(--status-error-default); }
    .ds-notif--warning { background: var(--status-warning-surface-l1); border-color: var(--status-warning-surface-l2); }
    .ds-notif--warning .ds-notif__icon { color: var(--status-warning-default); }
    .ds-notif--alert { background: var(--status-alert-surface-l1); border-color: var(--status-alert-surface-l2); }
    .ds-notif--alert .ds-notif__icon { color: var(--status-alert-default); }
    .ds-notif--info { background: var(--status-primary-surface-l1); border-color: var(--status-primary-surface-l2); }
    .ds-notif--info .ds-notif__icon { color: var(--status-primary-default); }
    .ds-notif--success { background: var(--status-success-surface-l1); border-color: var(--status-success-surface-l2); }
    .ds-notif--success .ds-notif__icon { color: var(--status-success-default); }

    /* ===== Alert / Banner ===== */
    .ds-alert {
      display: flex; align-items: flex-start;
      gap: var(--spacer-12);
      padding: var(--spacer-12) var(--spacer-16);
      background: var(--bg-base-secondary);
      border: 1px solid var(--border-neutral-l1);
      border-radius: var(--radius-8);
      color: var(--text-default);
      font-family: var(--body-md-font-family);
      font-size: var(--body-md-font-size);
      line-height: var(--body-md-line-height);
      letter-spacing: var(--body-md-letter-spacing);
    }
    .ds-alert__icon { flex: 0 0 16px; width: 16px; height: 16px; margin-top: var(--spacer-2); color: var(--icon-default); display: inline-flex; align-items: center; justify-content: center; }
    .ds-notif__icon .icon, .ds-alert__icon .icon { width: 16px; height: 16px; display: block; }
    .ds-alert--success .ds-alert__icon { color: var(--status-success-default); }
    .ds-alert--warning .ds-alert__icon { color: var(--status-warning-default); }
    .ds-alert--danger .ds-alert__icon { color: var(--status-error-default); }
    .ds-alert--info .ds-alert__icon { color: var(--status-primary-default); }
    .ds-alert__title { font-family: var(--body-md-strong-font-family); font-size: var(--body-md-strong-font-size); line-height: var(--body-md-strong-line-height); font-weight: var(--body-md-strong-font-weight); letter-spacing: var(--body-md-strong-letter-spacing); margin-bottom: var(--spacer-4); }
    .ds-alert__desc { color: var(--text-secondary); font-size: var(--body-md-font-size); line-height: var(--body-md-line-height); }

/* ===== Toast (global snackbar) ===== */
.toast-layer {
    position: fixed;
    inset: 0;
    z-index: var(--toast-z-index);
    pointer-events: none;
    overflow: visible;
}

.toast-container {
    position: fixed;
    top: var(--toast-offset-top);
    right: var(--toast-offset-right);
    left: var(--toast-offset-left);
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
    width: min(420px, calc(100% - 32px));
    pointer-events: none;
}

html.is-toast-drawer-rail-open,
body:has(.app-layout.is-notification-drawer-open) {
    --toast-offset-right: calc(var(--notification-drawer-width) + var(--space-16));
    --desktop-asset-cache-refresh-offset-right: calc(var(--notification-drawer-width) + var(--space-16));
}

html.is-toast-drawer-sheet-open .toast-container {
    right: auto;
    left: var(--space-16);
}

/* Desktop floating Burst Asset Cache control — sticky bottom-right; fades out while scrolling */
.desktop-feedback-composer {
    display: none;
}

.desktop-asset-cache-refresh {
    position: fixed;
    right: var(--desktop-asset-cache-refresh-offset-right, 16px);
    bottom: calc(var(--space-16, 16px) + env(safe-area-inset-bottom, 0px));
    z-index: var(--shell-z-fab, 1080);
    display: inline-flex;
    align-items: center;
    gap: var(--space-8, 8px);
    height: var(--toolbar-control-height, 40px);
    padding: 0 var(--space-14, 14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill, 999px);
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    cursor: pointer;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
        opacity 0.28s ease,
        transform 0.28s ease,
        visibility 0.28s ease,
        right var(--transition-base),
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.desktop-asset-cache-refresh.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
}

.desktop-asset-cache-refresh:hover {
    background: var(--bg-surface);
    border-color: var(--border-default);
    color: var(--text-brand);
}

.desktop-asset-cache-refresh:focus-visible {
    outline: 2px solid var(--border-brand, var(--text-brand));
    outline-offset: 2px;
}

.desktop-asset-cache-refresh[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.desktop-asset-cache-refresh.is-hidden[disabled] {
    opacity: 0;
}

.desktop-asset-cache-refresh__label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.desktop-asset-cache-refresh .ph {
    font-size: 16px;
    line-height: 1;
}

@media (min-width: 900px) {
    .desktop-feedback-composer {
        position: fixed;
        right: var(--desktop-asset-cache-refresh-offset-right, 16px);
        bottom: calc(var(--space-16, 16px) + 56px + var(--space-12, 12px) + env(safe-area-inset-bottom, 0px));
        z-index: var(--shell-z-fab, 1080);
        display: inline-flex !important;
        align-items: center;
        gap: var(--space-8, 8px);
        height: var(--toolbar-control-height, 40px);
        padding: 0 var(--space-14, 14px);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-pill, 999px);
        background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
        color: var(--text-main);
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(12px);
        cursor: pointer;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition:
            opacity 0.28s ease,
            transform 0.28s ease,
            visibility 0.28s ease,
            right var(--transition-base),
            background var(--transition-fast),
            border-color var(--transition-fast),
            color var(--transition-fast);
    }

    .desktop-feedback-composer.is-hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px);
    }

    .desktop-feedback-composer:hover {
        background: var(--bg-surface);
        border-color: var(--border-default);
        color: var(--text-brand);
    }

    .desktop-feedback-composer:focus-visible {
        outline: 2px solid var(--border-brand, var(--text-brand));
        outline-offset: 2px;
    }

    .desktop-feedback-composer[disabled] {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .desktop-feedback-composer.is-hidden[disabled] {
        opacity: 0;
    }

    .desktop-feedback-composer__label {
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .desktop-feedback-composer .ph {
        font-size: 16px;
        line-height: 1;
    }
}

@media (max-width: 899px) {
    .desktop-feedback-composer {
        display: none !important;
    }

    /* Keep Refresh FAB above typical mobile chrome / safe area. */
    .desktop-asset-cache-refresh {
        bottom: calc(var(--space-16, 16px) + env(safe-area-inset-bottom, 0px));
        right: max(var(--space-16, 16px), env(safe-area-inset-right, 0px));
    }
}

/* Email template management */
.email-templates-workspace {
    display: grid;
    grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
    gap: var(--space-16);
    align-items: start;
}

.email-templates-library,
.email-template-editor {
    min-width: 0;
    padding: var(--space-20);
}

.email-templates-library__head,
.email-template-editor__head,
.email-template-preview__head,
.email-template-editor__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-16);
}

.email-templates-library__head h2,
.email-template-editor__head h2,
.email-template-preview__head h3 {
    margin: 0;
    color: var(--text-main);
}

.email-templates-library__eyebrow {
    margin: 0 0 5px;
    color: var(--text-brand);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.email-templates-library__count {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    font-size: 12px;
    font-weight: 700;
}

.email-templates-list {
    display: grid;
    gap: var(--space-8);
    margin-top: var(--space-16);
}

.email-template-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.email-template-list-item:hover,
.email-template-list-item:focus-visible {
    border-color: var(--border-brand);
    background: var(--bg-brand-soft);
    outline: none;
    transform: translateY(-1px);
}

.email-template-list-item.is-active {
    border-color: color-mix(in srgb, var(--text-brand) 38%, var(--border-subtle));
    background: var(--bg-brand-soft);
    box-shadow: inset 3px 0 0 var(--text-brand);
}

.email-template-list-item__copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 4px;
}

.email-template-list-item__copy strong,
.email-template-list-item__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-template-list-item__copy strong { font-size: 13px; }
.email-template-list-item__copy small { color: var(--text-muted); font-size: 11px; }

.email-template-list-item__status {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: var(--radius-pill);
    background: var(--status-success-soft);
    color: var(--status-success);
    font-size: 10px;
    font-weight: 700;
}

.email-template-list-item__status.is-disabled {
    background: var(--bg-neutral-soft);
    color: var(--text-muted);
}

.email-template-editor__empty {
    display: grid;
    min-height: 420px;
    place-items: center;
    align-content: center;
    gap: var(--space-8);
    color: var(--text-muted);
    text-align: center;
}

.email-template-editor__empty[hidden],
#emailTemplateEditorContent[hidden] {
    display: none !important;
}

.email-template-editor__empty i {
    color: var(--text-brand);
    font-size: 32px;
}

.email-template-editor__empty h2 { margin: 0; color: var(--text-main); }
.email-template-editor__empty p { max-width: 42ch; margin: 0; }

.email-template-status {
    display: flex;
    flex: 0 1 260px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: 10px 12px;
}

.email-template-status strong,
.email-template-status small { display: block; }
.email-template-status small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }

.email-template-variables {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: var(--space-20) 0 var(--space-16);
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-base-secondary);
}

.email-template-variables__label {
    margin-right: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.email-template-variable-chip {
    padding: 4px 7px;
    border: 1px solid color-mix(in srgb, var(--text-brand) 22%, var(--border-subtle));
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-brand);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    cursor: pointer;
}

.email-template-variable-chip:hover,
.email-template-variable-chip:focus-visible {
    border-color: var(--text-brand);
    outline: 2px solid color-mix(in srgb, var(--text-brand) 18%, transparent);
    outline-offset: 1px;
}

.email-template-preview {
    margin-top: var(--space-20);
    padding: var(--space-16);
    background: var(--bg-base-secondary);
}

.email-template-preview__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-8);
}

.email-template-test-recipient input { width: min(220px, 100%); min-height: var(--toolbar-control-height); }
.email-template-preview iframe { display: block; width: 100%; min-height: 360px; margin-top: var(--space-16); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: #fff; }
.email-template-editor__footer { align-items: center; margin-top: var(--space-16); }

[data-theme="dark"] .email-template-preview iframe { background: #fff; }

@media (max-width: 899px) {
    .email-templates-workspace { grid-template-columns: 1fr; }
    .email-templates-library { position: static; }
    .email-template-editor__head,
    .email-template-preview__head,
    .email-template-editor__footer { align-items: stretch; flex-direction: column; }
    .email-template-status { flex-basis: auto; }
    .email-template-preview__actions { justify-content: stretch; }
    .email-template-test-recipient { flex: 1 1 100%; }
    .email-template-test-recipient input { width: 100%; }
    .email-template-preview__actions .btn { flex: 1 1 auto; }
}

/* Client portal shell: keep internal workspace controls out of the first paint. */
body.client-portal .header-search,
body.client-portal #topbarDepartmentMenu,
body.client-portal #topbarCreateMenu,
body.client-portal #topbarNotificationMenu,
body.client-portal #topbarNotificationMenuPortal,
body.client-portal #topbarMobileMenu,
body.client-portal #topbarMobileMenuPortal,
body.client-portal #topbarSearchSheetPortal,
body.client-portal #btnDesktopAssetCacheRefresh,
body.client-portal #btnDesktopFeedbackComposer,
body.client-portal .user-menu__preferences,
body.client-portal [data-user-menu-target="view-settings"],
body.client-portal [data-user-menu-target="keyboard-shortcuts"] {
    display: none !important;
}

body.client-portal .header-actions {
    margin-left: auto;
}

body.client-portal .sidebar-nav[data-client-portal-shell] > :not([data-client-portal-nav]),
body.client-portal .sidebar-nav[data-client-portal-shell] .sidebar-section:not(.sidebar-section--client-portal) {
    display: none !important;
}

body.client-portal .sidebar-section--client-portal {
    display: block !important;
}

body.client-portal .view-section:not(#view-reports) {
    display: none !important;
}

.page-filters-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--toolbar-control-height, 40px);
    color: var(--text-main);
    font-size: .8rem;
    font-weight: 600;
}

.page-filters-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
}

.reports-workspace {
    display: grid;
    gap: var(--space-16);
}

.reports-workspace__intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-20);
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.reports-workspace__eyebrow {
    margin: 0 0 6px;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.reports-workspace__intro h2 { margin: 0; color: var(--text-main); font-size: clamp(1.2rem, 2vw, 1.55rem); }
.reports-workspace__intro p:last-child { margin: 8px 0 0; color: var(--text-muted); }
.reports-workspace__mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: color-mix(in srgb, var(--brand-primary) 14%, transparent); color: var(--brand-primary); font-size: 1.35rem; }

.reports-toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.reports-toolbar__search, .reports-toolbar__select, .reports-toolbar__date { display: flex; align-items: center; min-height: var(--toolbar-control-height, 40px); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-muted); }
.reports-toolbar__search { flex: 1 1 260px; gap: 8px; padding: 0 12px; }
.reports-toolbar__search input, .reports-toolbar__select select, .reports-toolbar__date input { min-height: 38px; border: 0; outline: 0; background: transparent; color: var(--text-main); }
.reports-toolbar__search input { width: 100%; }
.reports-toolbar__select select { min-width: 170px; padding: 0 12px; }
.reports-toolbar__date { gap: 6px; padding: 0 10px; }
.reports-toolbar__date span { color: var(--text-muted); font-size: .72rem; font-weight: 750; }
.reports-toolbar__date input { width: 112px; }

.reports-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-12); }
.reports-summary__card { display: grid; gap: 8px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-main); text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .16s ease, transform .16s ease; }
.reports-summary__card:hover, .reports-summary__card:focus-visible { border-color: var(--brand-primary); transform: translateY(-1px); }
.reports-summary__label { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .72rem; font-weight: 750; }
.reports-summary__card strong { font-size: 1.45rem; line-height: 1; }
.reports-summary__card--warning strong { color: var(--status-warning); }
.reports-summary__card--danger strong { color: var(--status-danger); }
.reports-summary__card--success strong { color: var(--status-success); }

.reports-table-wrap,
.samples-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.reports-table,
.samples-table {
    width: 100%;
    min-width: 720px;
}

.reports-table { min-width: 1060px; }

.reports-table td,
.reports-table th,
.samples-table td,
.samples-table th {
    vertical-align: middle;
}

.reports-table th,
.samples-table th {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.reports-table td,
.samples-table td {
    padding-top: var(--space-14);
    padding-bottom: var(--space-14);
}

.reports-table__identity strong,
.samples-table td:first-child strong {
    display: block;
    color: var(--text-main);
    font-weight: 750;
}

.reports-table__sub, .reports-table__access { display: block; margin-top: 3px; color: var(--text-muted); font-size: .72rem; }
.samples-table__sub { display: block; margin-top: 3px; color: var(--text-muted); font-size: .72rem; }
.reports-table__access { color: var(--status-success); font-weight: 700; }
.reports-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--bg-overlay-l2); color: var(--text-main); font-size: .72rem; font-weight: 750; white-space: nowrap; }
.reports-status--approved, .reports-status--closed { background: color-mix(in srgb, var(--status-success) 14%, transparent); color: var(--status-success); }
.reports-status--awaiting_upload { background: color-mix(in srgb, var(--status-warning) 14%, transparent); color: var(--status-warning); }
.reports-status--uploaded, .reports-status--checked { background: color-mix(in srgb, var(--brand-primary) 12%, transparent); color: var(--brand-primary); }
.reports-status--client_available { background: color-mix(in srgb, var(--status-success) 14%, transparent); color: var(--status-success); }
.reports-status--changes_required { background: color-mix(in srgb, var(--status-danger) 12%, transparent); color: var(--status-danger); }
.reports-job-status { color: var(--text-muted); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.reports-job-status--completed, .reports-job-status--report-uploaded, .reports-job-status--report-checked, .reports-job-status--approved, .reports-job-status--closed { color: var(--status-success); }
.reports-table__warning { display: block; margin-top: 4px; color: var(--status-danger); font-size: .7rem; font-weight: 750; }
.reports-table__next-action { color: var(--text-main); font-size: .75rem; font-weight: 700; }
.reports-empty { display: grid; justify-items: center; gap: 8px; padding: 56px 24px; border: 1px dashed var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); text-align: center; }
.reports-empty__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: color-mix(in srgb, var(--brand-primary) 13%, transparent); color: var(--brand-primary); font-size: 1.25rem; }
.reports-empty h3 { margin: 4px 0 0; color: var(--text-main); }
.reports-empty p { max-width: 520px; margin: 0; color: var(--text-muted); }
.reports-empty--error .reports-empty__icon { background: color-mix(in srgb, var(--status-danger) 13%, transparent); color: var(--status-danger); }

@media (max-width: 700px) {
    .reports-workspace__intro { padding: 20px; }
    .reports-workspace__mark { flex: 0 0 auto; }
    .reports-toolbar__select { flex: 1 1 170px; }
    .reports-toolbar__select select { width: 100%; }
    .reports-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-toolbar__date { flex: 1 1 150px; }
    .reports-toolbar__date input { flex: 1; width: auto; }
}

/* Sample Management is scoped to the Samples workspace view. */
.samples-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-12);
    margin-bottom: var(--space-20);
}

.samples-kpi {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--space-6) var(--space-8);
    min-width: 0;
    padding: var(--space-14);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-muted);
}

.samples-kpi > i { color: var(--text-brand); font-size: 1.125rem; }
.samples-kpi > span { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.samples-kpi > strong { grid-column: 2; color: var(--text-main); font-size: 1.375rem; line-height: 1; }
.samples-kpi--stuck > i, .samples-kpi--stuck > strong { color: var(--status-danger); }

.sample-status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg-overlay-l2);
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}
.sample-status-badge--pending { background: var(--status-warning-surface-l1); color: var(--status-warning); }
.sample-status-badge--samples_delivered { background: var(--status-info-surface-l1); color: var(--status-info); }
.sample-status-badge--awb_generated { background: var(--bg-brand-soft); color: var(--text-brand); }
.sample-status-badge--samples_sent { background: var(--status-success-surface-l1); color: var(--status-success); }

.samples-table .table-actions { text-align: right; }

.sample-documents-panel { display: grid; gap: var(--space-10); }
.sample-document-heading, .sample-document-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-10); }
.sample-document-heading .form-field__helper { margin: var(--space-4) 0 0; }
.sample-document-count { flex: 0 0 auto; color: var(--text-muted); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.sample-document-toolbar { align-items: center; padding: var(--space-8) 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.sample-document-toolbar .ds-btn[hidden], .sample-document-dropzone[hidden], .sample-document-upload-row[hidden] { display: none !important; }
.sample-document-dropzone { display: grid; justify-items: center; gap: var(--space-4); padding: var(--space-14); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-muted); color: var(--text-muted); text-align: center; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, color .16s ease; }
.sample-document-dropzone:hover, .sample-document-dropzone:focus-visible, .sample-document-dropzone.is-dragover { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface-muted)); color: var(--text-main); outline: none; }
.sample-document-dropzone > i { color: var(--brand-primary); font-size: 1.5rem; }
.sample-document-dropzone > strong { color: var(--text-main); }
.sample-document-dropzone > span { font-size: .75rem; }
.sample-document-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.sample-document-upload-row { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-8); }
.sample-documents-list, .sample-document-queue { display: grid; gap: var(--space-6); }
.sample-document-row, .sample-document-queue__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-10); padding: var(--space-10); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-muted); }
.sample-document-row__identity, .sample-document-queue__file { display: flex; align-items: center; min-width: 0; gap: var(--space-8); }
.sample-document-row__icon { display: grid; flex: 0 0 auto; width: 2rem; height: 2rem; place-items: center; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--brand-primary) 12%, var(--surface-muted)); color: var(--brand-primary); }
.sample-document-row__meta, .sample-document-queue__file > span { display: grid; min-width: 0; gap: 2px; }
.sample-document-row__meta > span, .sample-document-row__meta > small, .sample-document-queue__file small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.sample-document-row__meta > small, .sample-document-queue__file small { font-size: .7rem; }
.sample-document-row__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-6); }
.sample-document-queue__type { flex: 0 1 220px; margin-left: auto; }
.sample-document-queue__type select { width: 100%; }
.sample-document-empty { display: grid; justify-items: center; gap: var(--space-4); padding: var(--space-14); border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); color: var(--text-muted); text-align: center; }
.sample-document-empty > i { color: var(--brand-primary); font-size: 1.35rem; }
.sample-document-empty strong { color: var(--text-main); }

.samples-mobile-sheet-portal,
.samples-picker-overlay {
    position: fixed;
    z-index: var(--shell-z-modal);
    inset: 0;
}
.samples-mobile-sheet__backdrop,
.samples-picker-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 50%, transparent);
}
.samples-mobile-sheet,
.samples-picker {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(88dvh, 760px);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
}
.samples-mobile-sheet header,
.samples-picker header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-20);
    border-bottom: 1px solid var(--border-subtle);
}
.samples-mobile-sheet h2, .samples-picker h2 { margin: 0; font-size: 1.125rem; }
.samples-mobile-sheet__body, .samples-picker__body { overflow-y: auto; padding: var(--space-20); }
.samples-mobile-sheet footer { padding: var(--space-12) var(--space-20); border-top: 1px solid var(--border-subtle); }
.samples-picker { width: min(520px, calc(100vw - 32px)); margin: min(16vh, 120px) auto; grid-template-rows: auto minmax(0, 1fr); }
.samples-picker__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); width: 100%; padding: var(--space-12) 0; border: 0; border-bottom: 1px solid var(--border-subtle); background: transparent; color: var(--text-main); text-align: left; }
.samples-picker__item > span { display: grid; gap: 2px; min-width: 0; }
.samples-picker__item small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 900px) {
    .samples-mobile-sheet-portal { display: none; }
}

@media (max-width: 899px) {
    .samples-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .samples-kpi:last-child { grid-column: 1 / -1; }
    .samples-mobile-sheet { position: absolute; right: 0; bottom: 0; left: 0; max-height: min(86dvh, 680px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .samples-picker { position: absolute; right: 0; bottom: 0; left: 0; width: auto; max-height: min(75dvh, 620px); margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .sample-document-heading, .sample-document-toolbar { align-items: flex-start; flex-direction: column; }
    .sample-document-toolbar { gap: var(--space-8); }
    .sample-document-row { align-items: stretch; flex-direction: column; }
    .sample-document-row__actions { justify-content: flex-start; }
    .sample-document-queue__item { align-items: stretch; flex-wrap: wrap; }
    .sample-document-queue__type { flex: 1 1 100%; order: 3; margin-left: 0; }
    .sample-document-queue__item > .icon-btn-small { margin-left: auto; }
}

[data-theme="dark"] .samples-kpi,
[data-theme="dark"] .samples-mobile-sheet,
[data-theme="dark"] .samples-picker { background: var(--bg-surface); }

@media (prefers-reduced-motion: reduce) {
    .desktop-feedback-composer {
        transition: none !important;
    }

    .desktop-asset-cache-refresh {
        transition: none !important;
    }
}

/* Hide feedback chrome while getDisplayMedia is capturing so it is not in the frame. */
html.is-feedback-screenshot-capturing #modalInternalFeedback,
html.is-feedback-screenshot-capturing #btnDesktopFeedbackComposer,
html.is-feedback-screenshot-capturing #btnDesktopAssetCacheRefresh,
html.is-feedback-screenshot-capturing #toastContainer,
html.is-feedback-screenshot-capturing #topbarMobileMenuPortal,
html.is-feedback-screenshot-capturing #topbarSearchSheetPortal {
    visibility: hidden !important;
    pointer-events: none !important;
}

.feedback-screenshot-panel {
    display: grid;
    gap: var(--space-12, 12px);
    margin-bottom: var(--space-20, 20px);
    padding: var(--space-16, 16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--bg-base-secondary) 55%, var(--bg-surface));
}

.feedback-screenshot-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12, 12px);
}

.feedback-screenshot-panel__intro {
    min-width: 0;
    flex: 1 1 auto;
}

.feedback-screenshot-panel__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-8, 8px);
    margin-bottom: var(--space-4, 4px);
}

.feedback-screenshot-panel__title-row .section-title {
    margin: 0;
}

.feedback-screenshot-panel__status {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-8, 8px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill, 999px);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.feedback-screenshot-panel__status[data-status="capturing"] {
    border-color: color-mix(in srgb, var(--status-primary-default) 35%, var(--border-subtle));
    color: var(--text-brand, var(--status-primary-default));
}

.feedback-screenshot-panel__status[data-status="ready"],
.feedback-screenshot-panel__status[data-status="uploaded"] {
    border-color: color-mix(in srgb, var(--status-success-default, #16a34a) 35%, var(--border-subtle));
    color: var(--status-success-default, #16a34a);
}

.feedback-screenshot-panel__status[data-status="error"] {
    border-color: color-mix(in srgb, var(--status-warning-default, #d97706) 40%, var(--border-subtle));
    color: var(--status-warning-default, #d97706);
}

.feedback-screenshot-panel__actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-8, 8px);
    flex: 0 0 auto;
}

.feedback-screenshot-panel__preview {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 88%, transparent), var(--bg-base-secondary));
}

.feedback-screenshot-panel__preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 280px;
    min-height: 160px;
    object-fit: cover;
    object-position: top center;
    background: var(--bg-surface);
}

.feedback-screenshot-panel__preview .text-muted {
    margin: 0;
}

.feedback-screenshot-panel__preview .loading-state-card {
    min-height: 180px;
    justify-content: center;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.feedback-screenshot-panel__empty-state {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: var(--space-8, 8px);
    min-height: 180px;
    place-content: center;
    padding: var(--space-20, 20px);
}

.feedback-screenshot-panel__empty-state strong {
    color: var(--text-strong);
}

.feedback-screenshot-panel__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-4, 4px);
    border-radius: var(--radius-pill, 999px);
    background: color-mix(in srgb, var(--bg-surface) 80%, var(--border-subtle));
    color: var(--text-muted);
}

.feedback-screenshot-panel__empty-icon .ph {
    font-size: 18px;
    line-height: 1;
}

.feedback-screenshot-panel__hint {
    margin: 0;
    max-width: 36ch;
}

.feedback-screenshot-panel[data-capture-status="error"] .feedback-screenshot-panel__preview {
    border-color: color-mix(in srgb, var(--status-warning-default, #d97706) 35%, var(--border-subtle));
}

.feedback-screenshot-panel[data-capture-status="ready"] .feedback-screenshot-panel__preview,
.feedback-screenshot-panel[data-capture-status="uploaded"] .feedback-screenshot-panel__preview {
    border-color: color-mix(in srgb, var(--status-success-default, #16a34a) 28%, var(--border-subtle));
}

.modal-content--feedback .modal-body {
    display: grid;
    gap: var(--space-4, 4px);
}

.modal-content--feedback .feedback-screenshot-panel {
    margin-bottom: var(--space-16, 16px);
}

[data-theme="dark"] .feedback-screenshot-panel {
    background: color-mix(in srgb, var(--bg-base-secondary) 70%, var(--bg-surface));
}

[data-theme="dark"] .feedback-screenshot-panel__preview {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 70%, transparent), var(--bg-base-secondary));
}

[data-theme="dark"] .feedback-screenshot-panel__empty-icon {
    background: color-mix(in srgb, var(--bg-surface) 65%, var(--border-subtle));
}

@media (max-width: 720px) {
    .feedback-screenshot-panel__header {
        flex-direction: column;
    }

    .feedback-screenshot-panel__actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.toast {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--space-10);
    padding: 14px 16px;
    border: 1px solid var(--border-neutral-l1);
    border-left: 4px solid var(--status-primary-default);
    border-radius: var(--radius-xl);
    background: var(--bg-base-default);
    color: var(--text-default);
    box-shadow: var(--shadow-lg);
    font-family: var(--body-md-font-family);
    font-size: var(--body-md-font-size);
    line-height: var(--body-md-line-height);
    transform: translateY(-10px);
    animation: toastIn 0.24s ease forwards;
}

.toast span {
    flex: 1;
    min-width: 0;
    color: var(--text-default);
    font-weight: var(--font-weight-strong);
}

.toast i {
    flex-shrink: 0;
    font-size: 22.5px;
    color: var(--status-primary-default);
}

.toast.success,
.toast.update {
    background: color-mix(in srgb, var(--status-success-default) 12%, var(--bg-base-default));
    border-color: color-mix(in srgb, var(--status-success-default) 18%, var(--border-neutral-l1));
    border-left-color: var(--status-success-default);
}

.toast.success i,
.toast.update i {
    color: var(--status-success-default);
}

.toast.error {
    background: color-mix(in srgb, var(--status-error-default) 12%, var(--bg-base-default));
    border-color: color-mix(in srgb, var(--status-error-default) 18%, var(--border-neutral-l1));
    border-left-color: var(--status-error-default);
}

.toast.error i {
    color: var(--status-error-default);
}

.toast.warning {
    background: color-mix(in srgb, var(--status-warning-default) 12%, var(--bg-base-default));
    border-color: color-mix(in srgb, var(--status-warning-default) 18%, var(--border-neutral-l1));
    border-left-color: var(--status-warning-default);
}

.toast.warning i {
    color: var(--status-warning-default);
}

@keyframes toastIn {
    to {
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@media (max-width: 720px) {
    :root {
        --toast-offset-top: calc(var(--space-12) * 2 + var(--toolbar-control-height) + var(--space-12));
    }
}

/* â”€â”€ Avatar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Avatar ===== */
    .ds-avatar {
      display: inline-flex; align-items: center; justify-content: center;
      width: 32px; height: 32px; border-radius: var(--radius-full);
      background: var(--bg-overlay-l3);
      color: var(--text-default);
      font-family: var(--body-base-strong-font-family);
      font-size: var(--body-base-strong-font-size);
      font-weight: var(--body-base-strong-font-weight);
      line-height: var(--body-base-strong-line-height);
      flex-shrink: 0;
    }
    .ds-avatar--sm { width: 24px; height: 24px; font-size: var(--body-sm-font-size); }
    .ds-avatar--lg { width: 40px; height: 40px; }
    .ds-avatar--xl { width: 48px; height: 48px; }
    .ds-avatar--profile { width: 80px; height: 80px; font-size: 24px; }

    .ds-avatar--image {
      position: relative;
      overflow: hidden;
      padding: 0;
      background: var(--bg-brand-soft);
      color: var(--text-brand);
    }

    .ds-avatar--image img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .ds-avatar__fallback {
      position: relative;
      z-index: 0;
      font-family: var(--body-base-strong-font-family);
      font-size: inherit;
      font-weight: var(--body-base-strong-font-weight);
      line-height: 1;
    }

    .ds-avatar--image:not(.is-fallback) .ds-avatar__fallback {
      display: none;
    }

    .ds-avatar--image.is-fallback img {
      display: none;
    }

    .avatar-seed-field__row {
      display: flex;
      align-items: center;
      gap: var(--spacer-12);
    }

    .avatar-seed-field__preview {
      flex: 0 0 auto;
    }

    .avatar-seed-field__row > input {
      flex: 1 1 auto;
      min-width: 0;
    }

    .client-brand-mark {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: var(--radius-full);
      background: var(--client-brand-color, var(--bg-overlay-l3));
      color: var(--text-white);
      flex-shrink: 0;
      box-shadow: 0 6px 16px color-mix(in srgb, var(--client-brand-color, var(--bg-overlay-l3)) 24%, transparent);
    }

    .client-brand-mark--sm {
      width: 24px;
      height: 24px;
      font-size: 11px;
    }

    .client-brand-mark--lg {
      width: 40px;
      height: 40px;
      font-size: 13px;
    }

    .client-brand-mark__logo {
      font-family: var(--body-base-strong-font-family);
      font-weight: var(--body-base-strong-font-weight);
      line-height: 1;
      letter-spacing: 0.01em;
    }

    .client-avatar {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      overflow: hidden;
      border-radius: var(--radius-full);
      background: var(--client-brand-color, var(--bg-overlay-l3));
      color: var(--text-white);
      box-shadow: 0 6px 16px color-mix(in srgb, var(--client-brand-color, var(--bg-overlay-l3)) 24%, transparent);
    }

    .client-avatar--initials,
    .client-avatar.is-fallback {
      background: var(--client-brand-color, var(--bg-overlay-l3));
    }

    .client-avatar__initials {
      font-family: var(--body-base-strong-font-family);
      font-weight: var(--body-base-strong-font-weight);
      line-height: 1;
      letter-spacing: 0.01em;
    }

    .client-avatar--logo img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .client-avatar-field__controls {
      display: flex;
      flex-direction: column;
      gap: var(--space-12);
      width: 100%;
    }

    .client-avatar-field__preview {
      display: flex;
      align-items: center;
      gap: var(--space-12);
    }

    .client-avatar-field__options {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-8);
    }

    .client-avatar-mode-btn.is-active {
      border-color: color-mix(in srgb, var(--bg-brand) 45%, var(--border-subtle));
      background: color-mix(in srgb, var(--bg-brand) 12%, var(--bg-surface));
      color: var(--text-main);
    }

    .client-avatar-field__upload {
      display: flex;
      flex-direction: column;
      gap: var(--space-8);
    }

    .client-avatar-field__upload[hidden] {
      display: none !important;
    }

    .client-directory-card--sub {
      margin-left: var(--space-16);
      border-style: dashed;
    }

    [data-theme="dark"] .client-avatar-mode-btn.is-active {
      background: color-mix(in srgb, var(--bg-brand) 22%, var(--bg-surface));
    }

    [data-theme="dark"] .client-brand-mark {
      color: var(--text-white);
    }

/* â”€â”€ Breadcrumb â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Breadcrumb ===== */
    .ds-breadcrumb { display: flex; align-items: center; gap: var(--spacer-8); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); color: var(--text-tertiary); }
    .ds-breadcrumb a { display: inline-flex; align-items: center; color: var(--text-tertiary); }
    .ds-breadcrumb a:hover { color: var(--text-default); }
    .ds-breadcrumb__sep { color: var(--text-tertiary); }
    .ds-breadcrumb__current { color: var(--text-default); }

/* â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Buttons ===== */
    .ds-btn {
      display: inline-flex; align-items: center; justify-content: center;
      gap: var(--spacer-6);
      height: 28px; padding: 0 var(--spacer-12);
      border-radius: var(--radius-8);
      border: 1px solid transparent;
      cursor: pointer; user-select: none; white-space: nowrap;
      font-family: var(--body-base-strong-font-family);
      font-size: var(--body-base-strong-font-size);
      line-height: var(--body-base-strong-line-height);
      font-weight: var(--body-base-strong-font-weight);
      letter-spacing: var(--body-base-strong-letter-spacing);
      transition: background .12s ease, color .12s ease, border-color .12s ease, opacity .12s ease;
    }
    .ds-btn .icon {
      display: inline-block;
      width: var(--icon-size-16);
      height: var(--icon-size-16);
      flex: 0 0 auto;
    }
    .ds-btn .icon--12 { width: var(--icon-size-12); height: var(--icon-size-12); }
    .ds-btn .icon--14 { width: var(--icon-size-14); height: var(--icon-size-14); }
    .ds-btn .icon--16 { width: var(--icon-size-16); height: var(--icon-size-16); }
    .ds-btn .icon--20 { width: var(--icon-size-20); height: var(--icon-size-20); }
    .ds-btn .icon--24 { width: var(--icon-size-24); height: var(--icon-size-24); }
    /* Button heights are fixed to 24 / 28 / 32px. */
    .ds-btn--sm { height: 24px; padding: 0 var(--spacer-8); border-radius: var(--radius-8); font-size: var(--body-sm-font-size); }
    .ds-btn--md { height: 28px; padding: 0 var(--spacer-12); border-radius: var(--radius-8); }
    .ds-btn--lg { height: 32px; padding: 0 var(--spacer-16); border-radius: var(--radius-8); font-size: var(--body-base-font-size); }
    .ds-btn--primary { background: var(--bg-invert); color: var(--text-white); border-color: var(--bg-invert); }
    .ds-btn--primary:hover { background: var(--bg-invert-hover); border-color: var(--bg-invert-hover); }
    .ds-btn--primary:active { background: var(--bg-invert-active); border-color: var(--bg-invert-active); }
    .ds-btn--primary[disabled] { background: var(--bg-invert-disabled); color: var(--text-disabled); border-color: transparent; cursor: not-allowed; }
    .ds-btn--secondary { background: var(--bg-overlay-l1); color: var(--text-default); border-color: var(--border-neutral-l1); }
    .ds-btn--secondary:hover { background: var(--bg-overlay-l2); border-color: var(--border-neutral-l2); }
    .ds-btn--secondary:active { background: var(--bg-overlay-l3); border-color: var(--border-neutral-l3); }
    .ds-btn--secondary[disabled] { color: var(--text-disabled); cursor: not-allowed; opacity: .7; }
    .ds-btn--tertiary,
    .ds-btn--ghost { background: transparent; color: var(--text-default); border-color: transparent; }
    .ds-btn--tertiary:hover,
    .ds-btn--ghost:hover { background: var(--bg-overlay-l2); color: var(--text-default-hover); }
    .ds-btn--tertiary:active,
    .ds-btn--ghost:active { background: var(--bg-overlay-l3); }
    .ds-btn--tertiary[disabled],
    .ds-btn--ghost[disabled] { color: var(--text-disabled); cursor: not-allowed; }
    .ds-btn--danger,
    .ds-btn--danger-strong { background: var(--status-error-default); color: var(--text-onaccent); border-color: var(--status-error-default); }
    .ds-btn--danger:hover,
    .ds-btn--danger-strong:hover { background: var(--status-error-hover); border-color: var(--status-error-hover); }
    .ds-btn--danger:active,
    .ds-btn--danger-strong:active { background: var(--status-error-active); border-color: var(--status-error-active); }
    .ds-btn--danger-subtle { background: var(--status-error-surface-l1); color: var(--status-error-default); border-color: var(--status-error-surface-l2); }
    .ds-btn--danger-subtle:hover { background: var(--status-error-surface-l2); }
    .ds-btn--danger-subtle:active { background: var(--status-error-surface-l3); }
    .ds-btn--warning { background: var(--status-warning-default); color: var(--text-onaccent); border-color: var(--status-warning-default); }
    .ds-btn--warning:hover { background: var(--status-warning-hover); border-color: var(--status-warning-hover); }
    .ds-btn--warning:active { background: var(--status-warning-active); border-color: var(--status-warning-active); }
    .ds-btn--brand { background: var(--bg-brand); color: var(--text-onbrand); border-color: var(--bg-brand); }
    .ds-btn--brand:hover { background: var(--bg-brand-hover); border-color: var(--bg-brand-hover); }
    .ds-btn--brand:active { background: var(--bg-brand-active); border-color: var(--bg-brand-active); }
    .ds-btn--brand[disabled] { background: var(--bg-brand-disabled); border-color: transparent; color: var(--text-onbrand); cursor: not-allowed; }
    .ds-btn--link { background: transparent; color: var(--text-default); border-color: transparent; padding: 0; height: auto; }
    .ds-btn--link:hover { color: var(--text-default-hover); text-decoration: underline; }
    .ds-btn--link[disabled] { color: var(--text-disabled); text-decoration: none; cursor: not-allowed; }
    .ds-btn--icon { width: 28px; padding: 0; justify-content: center; }
    .ds-btn--icon.ds-btn--sm { width: 24px; }
    .ds-btn--icon.ds-btn--lg { width: 32px; }
    .ds-btn-group { display: inline-flex; }
    .ds-btn-group > .ds-btn { border-radius: var(--radius-0); margin-left: calc(-1 * var(--border-width-default)); }
    .ds-btn-group > .ds-btn:first-child { border-top-left-radius: var(--radius-8); border-bottom-left-radius: var(--radius-8); margin-left: 0; }
    .ds-btn-group > .ds-btn:last-child { border-top-right-radius: var(--radius-8); border-bottom-right-radius: var(--radius-8); }

/* â”€â”€ Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Card ===== */
    .ds-card {
      background: var(--bg-base-secondary);
      border: 1px solid var(--border-neutral-l1);
      border-radius: var(--radius-12);
      padding: var(--spacer-20);
      color: var(--text-default);
    }
    .ds-card__title { font-size: var(--heading-sm-font-size); line-height: var(--heading-sm-line-height); font-weight: var(--heading-sm-font-weight); margin-bottom: var(--spacer-8); }
    .ds-card__desc { font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); color: var(--text-secondary); }

/* â”€â”€ Dialog â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Dialog / Modal ===== */
    .ds-backdrop { position: relative; background: var(--bg-overlay-l4); border: 1px solid var(--border-neutral-l1); padding: var(--spacer-32) var(--spacer-24); display: flex; align-items: center; justify-content: center; }
    .ds-dialog { background: var(--bg-base-default); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-12); width: 100%; max-width: 520px; overflow: hidden; color: var(--text-default); box-shadow: 0 24px 64px color-mix(in srgb, var(--text-default) 14%, transparent), 0 4px 16px color-mix(in srgb, var(--text-default) 8%, transparent); }
    .ds-dialog--form { max-width: 560px; }
    .ds-dialog__head { padding: var(--spacer-16) var(--spacer-20); display: flex; align-items: center; justify-content: space-between; border-bottom: 0; }
    .ds-dialog__title { font-size: var(--heading-sm-font-size); line-height: var(--heading-sm-line-height); font-weight: var(--heading-sm-font-weight); color: var(--text-default); }
    .ds-dialog__close { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--icon-secondary); cursor: pointer; border-radius: var(--radius-8); }
    .ds-dialog__close:hover { background: var(--bg-overlay-l2); color: var(--icon-default); }
    .ds-dialog__body { padding: var(--spacer-16) var(--spacer-20); color: var(--text-secondary); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); }
    .ds-dialog__foot { padding: var(--spacer-12) var(--spacer-20); display: flex; justify-content: flex-end; gap: var(--spacer-8); border-top: 0; }
    .ds-drawer { background: var(--bg-base-default); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-12); width: 100%; max-width: 360px; display: flex; flex-direction: column; box-shadow: 0 24px 64px color-mix(in srgb, var(--text-default) 14%, transparent), 0 4px 16px color-mix(in srgb, var(--text-default) 8%, transparent); }
    .ds-drawer__head { padding: var(--spacer-16) var(--spacer-20); display: flex; justify-content: space-between; align-items: center; border-bottom: 0; }
    .ds-drawer__body { padding: var(--spacer-16) var(--spacer-20); flex: 1; }
    .dialog-form { display: grid; gap: var(--spacer-16); }
    .dialog-field { display: flex; flex-direction: column; gap: var(--spacer-6); }
    .dialog-field__label { color: var(--text-default); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); font-weight: var(--font-weight-medium); }
    .dialog-field__hint { color: var(--text-tertiary); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); }
    .dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spacer-12); }
    .dialog-form .ds-input,
    .dialog-form .ds-select,
    .dialog-form .ds-textarea { background: var(--bg-base-default); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); letter-spacing: var(--body-base-letter-spacing); }
    .dialog-form .ds-input:focus-within,
    .dialog-form .ds-select:focus,
    .dialog-form .ds-textarea:focus { background: var(--bg-base-default); }
    .dialog-form .ds-textarea { min-height: 72px; resize: none; }
    .dialog-calendar-icon { width: 16px; height: 16px; color: var(--icon-secondary); object-fit: contain; }
    @media (max-width: 720px) { .dialog-grid { grid-template-columns: 1fr; } }

/* â”€â”€ Forms â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Input / Search ===== */
    .ds-input { display: flex; align-items: center; gap: var(--spacer-8); min-height: 32px; padding: 0 var(--spacer-12); background: var(--bg-base-default); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-8); color: var(--text-default); width: 100%; font-family: var(--body-base-font-family); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); }
    .ds-input:focus-within { border-color: var(--border-contrast); background: var(--bg-base-default); }
    .ds-input input { flex: 1; background: transparent; border: none; outline: none; color: var(--text-default); font: inherit; min-width: 0; }
    .ds-input input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
    .ds-input input[type="number"]::-webkit-outer-spin-button,
    .ds-input input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .ds-input input::placeholder { color: var(--text-tertiary); }
    .ds-input input:disabled { color: var(--text-disabled); cursor: not-allowed; }
    .ds-input input[readonly] { color: var(--text-disabled); cursor: not-allowed; }
    .ds-input.is-error { border-color: var(--status-error-default); }
    .ds-input.is-disabled { background: var(--bg-base-secondary); color: var(--text-disabled); cursor: not-allowed; }
    .ds-input__icon { color: var(--icon-secondary); display: inline-flex; align-items: center; }
    .ds-search { position: relative; }
    .ds-select { width: 100%; height: 32px; padding: 0 var(--spacer-32) 0 var(--spacer-12); background-color: var(--bg-base-default); color: var(--text-default); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-8); appearance: none; -webkit-appearance: none; font: inherit; font-size: var(--body-base-font-size); }
    .ds-select:focus { border-color: var(--border-contrast); background-color: var(--bg-base-default); outline: none; }
    .ds-select:disabled { background-color: var(--bg-base-secondary); color: var(--text-disabled); cursor: not-allowed; opacity: 1; }
    .ds-select-wrap { position: relative; width: 100%; }
    .ds-select-wrap .ds-select { padding-right: var(--spacer-32); }
    .ds-select__icon { position: absolute; right: var(--spacer-12); top: 50%; width: 16px; height: 16px; color: var(--icon-secondary); pointer-events: none; transform: translateY(-50%); object-fit: contain; }
    .ds-select-wrap > .icon-img { position: absolute; top: 50%; right: var(--spacer-10); transform: translateY(-50%); color: var(--icon-secondary); pointer-events: none; }
    .icon-img { display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; object-fit: contain; vertical-align: middle; }
    .icon-img--12 { width: 12px; height: 12px; flex-basis: 12px; }
    .icon-img--14 { width: 14px; height: 14px; flex-basis: 14px; }
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .searchable-select {
        position: relative;
        width: 100%;
    }
    .searchable-select.searchable-select--open {
        z-index: var(--shell-z-picker, 1120);
    }
    .searchable-select > select {
        pointer-events: none;
    }
    .searchable-select__toggle {
        position: absolute;
        inset: 0;
        z-index: 3;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: transparent;
        cursor: pointer;
    }
    .searchable-select__toggle i {
        position: absolute;
        right: var(--space-12);
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 16px;
        pointer-events: none;
    }
    .searchable-select__toggle:focus-visible {
        outline: none;
    }
    .searchable-select__panel {
        position: absolute;
        left: 0;
        top: calc(100% + 8px);
        z-index: var(--shell-z-picker, 1120);
        display: flex;
        flex-direction: column;
        gap: var(--space-8);
        width: 100%;
        max-width: calc(100vw - 24px);
        box-sizing: border-box;
        padding: var(--space-12);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-surface);
        box-shadow: 0 18px 36px color-mix(in srgb, var(--bg-brand) 12%, transparent);
        max-height: var(--searchable-select-panel-max-height, min(320px, calc(100vh - 24px)));
        min-height: 0;
        overflow: hidden;
    }
    .searchable-select__panel[hidden] {
        display: none !important;
    }
    .searchable-select.searchable-select--open-upward > .searchable-select__panel {
        top: auto;
        bottom: calc(100% + 8px);
    }
    .searchable-select__panel--desktop-portal {
        position: fixed !important;
        z-index: var(--shell-z-picker, 1120) !important;
    }
    .searchable-select__search-row {
        display: flex;
        align-items: center;
        gap: var(--space-8);
        min-height: 36px;
        padding: 0 var(--space-12);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        background: var(--bg-base-default);
    }
    .searchable-select__search-row i {
        flex: 0 0 auto;
        color: var(--text-muted);
    }
    .searchable-select__search,
    .searchable-select__search:focus,
    .searchable-select__search:focus-visible {
        width: 100%;
        min-height: 32px;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
        color: var(--text-main);
        outline: none;
    }
    .searchable-select__search::placeholder {
        color: var(--text-muted);
    }
    .searchable-select__options {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-height: 0;
        max-height: 100%;
        overflow: auto;
        overscroll-behavior: contain;
        padding-right: 2px;
    }
    .searchable-select__option-row {
        display: flex;
        align-items: stretch;
        gap: 4px;
        min-width: 0;
    }
    .searchable-select__option-row.is-selected .searchable-select__option {
        background: color-mix(in srgb, var(--bg-brand) 16%, var(--bg-surface));
        font-weight: 600;
    }
    .searchable-select__option-row .searchable-select__option {
        flex: 1 1 auto;
        min-width: 0;
    }
    .searchable-select__option-edit {
        flex: 0 0 auto;
        align-self: center;
        opacity: 0.88;
        color: var(--text-secondary, inherit);
    }
    .searchable-select__option-row:hover .searchable-select__option-edit,
    .searchable-select__option-edit:focus-visible {
        opacity: 1;
        color: var(--text-primary, inherit);
    }
    .searchable-select__option {
        width: 100%;
        padding: 10px 12px;
        border: 0;
        border-radius: var(--radius-sm);
        background: transparent;
        color: var(--text-main);
        text-align: left;
        cursor: pointer;
        transition: background var(--transition-fast), color var(--transition-fast);
    }
    .searchable-select__option:hover,
    .searchable-select__option:focus-visible {
        background: color-mix(in srgb, var(--bg-brand) 10%, var(--bg-surface));
        outline: none;
    }
    .searchable-select__option.is-selected {
        background: color-mix(in srgb, var(--bg-brand) 16%, var(--bg-surface));
        font-weight: 600;
    }
    .searchable-select__option--create {
        color: var(--text-brand, var(--accent));
        font-weight: 600;
        border-top: 1px solid var(--border-subtle);
        margin-top: 4px;
    }
    .searchable-select__option--create:hover,
    .searchable-select__option--create:focus-visible {
        background: color-mix(in srgb, var(--bg-brand) 12%, var(--bg-surface));
    }
    .searchable-select__option:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }
    .searchable-select__empty {
        padding: var(--space-8) var(--space-4);
        color: var(--text-muted);
        font-size: 13px;
    }
    .searchable-select--multiple {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        align-content: flex-start;
        gap: 6px;
        min-height: 40px;
        height: auto !important;
        padding: 6px 32px 6px 8px;
        box-sizing: border-box;
    }
    .searchable-select--multiple > select.searchable-select__native,
    .form-field__control.searchable-select--multiple > select,
    .form-field__control.is-select.searchable-select--multiple > select[multiple] {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: 0 0 auto !important;
        align-self: auto !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0 !important;
        opacity: 0;
        pointer-events: none;
    }
    .searchable-select__summary {
        position: relative;
        z-index: 4;
        display: flex;
        flex: 1 1 auto;
        flex-wrap: wrap;
        align-items: center;
        align-content: flex-start;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 28px;
        box-sizing: border-box;
    }
    .searchable-select__placeholder {
        color: var(--text-muted);
        font-size: 14px;
        line-height: 1.3;
        padding: 2px 4px;
    }
    .searchable-select__chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        max-width: 100%;
        min-height: 26px;
        padding: 2px 4px 2px 8px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--bg-brand) 14%, var(--bg-surface));
        color: var(--text-main);
        font-size: 12px;
        line-height: 1.2;
    }
    .searchable-select__chip-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .searchable-select__chip-remove {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
    }
    .searchable-select__chip-remove:hover,
    .searchable-select__chip-remove:focus-visible {
        color: var(--text-main);
        background: color-mix(in srgb, var(--bg-brand) 18%, transparent);
        outline: none;
    }
    .searchable-select__option--multi {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .searchable-select__option-check {
        flex: 0 0 auto;
        color: var(--text-muted);
        font-size: 16px;
    }
    .searchable-select__option.is-selected .searchable-select__option-check {
        color: var(--text-brand, var(--accent));
    }
    .searchable-select__option-label {
        min-width: 0;
        flex: 1 1 auto;
    }
    [data-theme="dark"] .searchable-select__chip {
        background: color-mix(in srgb, var(--bg-brand) 22%, var(--bg-surface));
    }

    .nomination-email-sample__body {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        font-size: 13px;
        line-height: 1.45;
        white-space: pre-wrap;
        min-height: 280px;
        resize: vertical;
    }
    #modalNominationEmailSample .settings-inline-actions .btn.is-active {
        border-color: color-mix(in srgb, var(--bg-brand) 40%, var(--border-subtle));
        background: color-mix(in srgb, var(--bg-brand) 14%, var(--bg-surface));
        color: var(--text-main);
        font-weight: 600;
    }

/* ==========================================
   Searchable Select Sheet (mobile dropdown)
========================================== */

.searchable-select-sheet__portal {
    position: fixed;
    inset: 0;
    /* Above modals (1100): same stacking as date/color pickers so selects work inside dialogs. */
    z-index: var(--shell-z-picker);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.searchable-select-sheet__portal[hidden] {
    display: none !important;
}

.searchable-select-sheet__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--bg-overlay);
    cursor: pointer;
}

.searchable-select-sheet__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(85vh, 720px);
    border: 1px solid var(--border-subtle);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 98%, var(--bg-brand) 2%) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.searchable-select-sheet__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-16) var(--space-12);
    border-bottom: 1px solid var(--border-subtle);
    flex: 0 0 auto;
}

.searchable-select-sheet__title {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 700;
}

.searchable-select-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
}

.searchable-select-sheet__body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: var(--space-12) var(--space-16) calc(var(--space-16) + env(safe-area-inset-bottom, 0px));
    overflow: auto;
}

.searchable-select-sheet__content,
.searchable-select-sheet__body > .searchable-select__panel {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
}

.searchable-select-sheet__content .searchable-select__search-row,
.searchable-select-sheet__content .searchable-select__options,
.searchable-select-sheet__body > .searchable-select__panel .searchable-select__search-row,
.searchable-select-sheet__body > .searchable-select__panel .searchable-select__options {
    max-width: none;
}

.searchable-select-sheet__content .searchable-select__options,
.searchable-select-sheet__body > .searchable-select__panel .searchable-select__options {
    max-height: min(50vh, 360px);
}

/* When the keyboard is open, the portal is sized to the visual viewport — keep
   the sheet panel full-height with a sticky search row and scrollable options. */
.searchable-select-sheet__portal[data-bottom-sheet-viewport-synced="portal"] {
    align-items: flex-end;
}

.searchable-select-sheet__portal[data-bottom-sheet-viewport-synced="portal"] .searchable-select-sheet__panel {
    max-height: 100%;
    height: min(100%, 720px);
}

.searchable-select-sheet__portal[data-bottom-sheet-viewport-synced="portal"] .searchable-select-sheet__body {
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.searchable-select-sheet__portal[data-bottom-sheet-viewport-synced="portal"] .searchable-select-sheet__content,
.searchable-select-sheet__portal[data-bottom-sheet-viewport-synced="portal"] .searchable-select-sheet__body > .searchable-select__panel {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
}

.searchable-select-sheet__portal[data-bottom-sheet-viewport-synced="portal"] .searchable-select__search-row {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-surface);
}

.searchable-select-sheet__portal[data-bottom-sheet-viewport-synced="portal"] .searchable-select__options {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow: auto;
}

.field-affix-wrap,
    .input-icon-wrap,
    .date-input-wrap,
    .time-input-wrap,
    .color-input-wrap {
        position: relative;
        display: flex;
        align-items: center;
        gap: var(--space-8);
        min-height: 32px;
        padding: 0 var(--space-12);
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-8);
        background: var(--bg-base-default);
        color: var(--text-default);
        width: 100%;
        font-family: var(--body-base-font-family);
        font-size: var(--body-base-font-size);
        line-height: var(--body-base-line-height);
        transition: border-color var(--transition-fast), background var(--transition-fast);
    }
    .field-affix-wrap:focus-within,
    .input-icon-wrap:focus-within,
    .date-input-wrap:focus-within,
    .time-input-wrap:focus-within,
    .color-input-wrap:focus-within {
        border-color: var(--border-contrast);
        background: var(--bg-base-default);
    }
    .field-affix-wrap > input,
    .field-affix-wrap > select,
    .field-affix-wrap > textarea,
    .input-icon-wrap > input,
    .input-icon-wrap > select,
    .input-icon-wrap > textarea,
    .date-input-wrap > input,
    .time-input-wrap > input,
    .color-input-wrap > input {
        flex: 1;
        min-width: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent;
        color: inherit;
        font: inherit;
        outline: none;
    }
    .field-affix-wrap > input::placeholder,
    .field-affix-wrap > textarea::placeholder,
    .input-icon-wrap > input::placeholder,
    .input-icon-wrap > textarea::placeholder,
    .date-input-wrap > input::placeholder {
        color: var(--text-tertiary);
    }
    .field-affix-wrap > input:disabled,
    .field-affix-wrap > select:disabled,
    .field-affix-wrap > textarea:disabled,
    .input-icon-wrap > input:disabled,
    .input-icon-wrap > select:disabled,
    .input-icon-wrap > textarea:disabled,
    .date-input-wrap > input:disabled {
        color: var(--text-disabled);
        cursor: not-allowed;
    }
    .field-affix-wrap > input[readonly],
    .field-affix-wrap > textarea[readonly],
    .input-icon-wrap > input[readonly],
    .input-icon-wrap > textarea[readonly],
    .date-input-wrap > input[readonly] {
        color: var(--text-disabled);
        cursor: not-allowed;
    }
    .field-affix-wrap > input[type="number"],
    .input-icon-wrap > input[type="number"],
    .date-input-wrap > input[type="number"] {
        appearance: textfield;
        -moz-appearance: textfield;
    }
    .field-affix-wrap > input[type="number"]::-webkit-outer-spin-button,
    .field-affix-wrap > input[type="number"]::-webkit-inner-spin-button,
    .input-icon-wrap > input[type="number"]::-webkit-outer-spin-button,
    .input-icon-wrap > input[type="number"]::-webkit-inner-spin-button,
    .date-input-wrap > input[type="number"]::-webkit-outer-spin-button,
    .date-input-wrap > input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    .date-input-wrap__trigger {
        position: static;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        flex: 0 0 auto;
    }
    .date-input-wrap__trigger i {
        font-size: 16px;
        line-height: 1;
        pointer-events: none;
    }
    .date-input-wrap__trigger:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }
    .date-input-wrap:focus-within .date-input-wrap__trigger {
        color: var(--text-secondary);
    }
    .ds-textarea { width: 100%; min-height: 96px; padding: var(--spacer-8) var(--spacer-12); background: var(--bg-base-default); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-8); color: var(--text-default); font-family: var(--body-base-font-family); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); resize: none; }
    .ds-textarea:focus { outline: none; border-color: var(--border-contrast); background: var(--bg-base-default); }
    .ds-textarea.is-error { border-color: var(--status-error-default); }
    /* Runtime .form-field__control wrappers own the border; inner controls stay chrome-free. */
    .form-field__control > input,
    .form-field__control > select,
    .form-field__control > textarea {
        width: 100%;
        min-height: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        outline: none;
        color: inherit;
        font: inherit;
    }
    .form-field__control:not(.is-select):not(.is-textarea) > input {
        flex: 1;
        align-self: stretch;
        min-height: 36px;
    }
    .form-field__control.is-select > select {
        flex: 1;
        align-self: stretch;
        min-width: 0;
        position: relative;
        z-index: 1;
        min-height: 36px;
        padding: 0 var(--spacer-24) 0 0;
        height: auto;
        cursor: pointer;
    }
    /* Native multi listboxes only (not searchable multi chips). */
    .form-field__control.is-select:not(.searchable-select--multiple):has(> select[multiple]) {
        height: auto;
        min-height: 0;
        align-items: stretch;
        padding: var(--spacer-8);
    }
    .form-field__control.is-select:not(.searchable-select--multiple) > select[multiple] {
        min-height: 9.5rem;
        padding: 0;
        background-image: none;
        cursor: default;
    }
    .form-field__control.searchable-select--multiple,
    .form-field__control.is-select.searchable-select--multiple {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        align-content: flex-start;
        height: auto;
        min-height: 40px;
        padding: 6px 32px 6px 8px;
    }
    .form-field__control.is-textarea > textarea { min-height: 84px; resize: vertical; }
    .form-field__control > input:focus,
    .form-field__control > select:focus,
    .form-field__control > textarea:focus {
        border-color: transparent;
        box-shadow: none;
        outline: none;
        background: transparent;
    }
    .form-field__control > input:disabled,
    .form-field__control > select:disabled,
    .form-field__control > textarea:disabled {
        background: transparent;
        cursor: not-allowed;
    }
    .form-field__control.is-readonly {
        background: var(--bg-base-secondary);
        border-color: var(--border-subtle);
        cursor: not-allowed;
    }
    .form-field__control.is-readonly:focus-within {
        border-color: var(--border-subtle);
        box-shadow: none;
    }
    .form-field__control > input[readonly],
    .form-field__control > input:read-only,
    .form-field__control > textarea[readonly],
    .form-field__control > textarea:read-only {
        color: var(--text-disabled);
        background: transparent;
        cursor: not-allowed;
        user-select: text;
    }
    .toggle-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--spacer-16);
    }
    .toggle-row h4 {
        margin: 0;
    }
    .settings-toggle-card {
        padding: var(--spacer-16) var(--spacer-20);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        background: var(--bg-surface);
    }
    .input-grid .settings-toggle-card { grid-column: span 2; }
    [data-email-notification-settings][hidden],
    [data-whatsapp-settings][hidden],
    [data-smtp-settings][hidden],
    [data-smtp-auth-settings][hidden],
    .input-group[hidden],
    .input-group[data-smtp-auth-settings][hidden],
    .settings-inline-actions[hidden] {
        display: none !important;
    }
    .settings-inline-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-12);
        margin-top: var(--space-16);
    }
    .settings-inline-actions .btn-sm {
        min-height: 32px;
    }
    .page-tab-panel > .settings-inline-actions {
        margin-top: 0;
    }
    .settings-fields-stack > .settings-inline-actions {
        margin-top: 0;
    }
    .settings-fields-stack {
        display: flex;
        flex-direction: column;
        gap: var(--space-16);
    }
    .settings-section-card .input-grid {
        align-items: start;
    }
    .settings-format-preview {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        min-height: 72px;
        padding: var(--space-12) var(--space-16);
        border: 1px solid color-mix(in srgb, var(--border-brand) 28%, var(--border-subtle));
        border-radius: var(--radius-lg);
        background: color-mix(in srgb, var(--bg-brand-soft) 55%, var(--bg-surface));
        color: var(--text-main);
    }
    .settings-format-preview__eyebrow {
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .settings-format-preview strong {
        font-size: 18px;
        letter-spacing: .01em;
    }
    .form-field__label,
    .input-group > label:not(.switch) {
        display: inline-flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: var(--space-6);
    }
    .input-group:has(input:required, select:required, textarea:required) > label:not(.switch)::after {
        content: "(Required)";
        color: var(--status-error-default);
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.01em;
        margin-inline-start: 0;
    }
    .form-field__helper {
        margin: 0;
        font-size: 13px;
        line-height: 1.45;
        color: var(--text-muted);
    }
    .form-field__helper code {
        font-size: 12px;
    }
    .job-agency-helper {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-8, 8px);
    }
    .job-agency-call {
        font-weight: 600;
        color: var(--text-brand, var(--bg-brand));
        text-decoration: none;
    }
    .job-agency-call:hover {
        text-decoration: underline;
    }
    .system-settings-caching-grid > .input-group.full {
        grid-column: span 2;
    }
    .system-settings-caching-grid > .input-group,
    .system-settings-caching-grid > .settings-toggle-card { grid-column: span 1; }
    .ds-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--bg-overlay-l3); border-radius: var(--radius-full); outline: none; }
    .ds-slider--progress { background: var(--bg-overlay-l3); }
    .ds-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: var(--radius-full); background: var(--bg-base-default); border: 1px solid var(--border-neutral-l3); box-shadow: none; cursor: pointer; }
    .ds-slider::-moz-range-track { height: 4px; background: var(--bg-overlay-l3); border-radius: var(--radius-full); }
    .ds-slider--progress::-moz-range-progress { height: 4px; background: var(--bg-brand); border-radius: var(--radius-full); }
    .ds-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: var(--radius-full); background: var(--bg-base-default); border: 1px solid var(--border-neutral-l3); box-shadow: none; cursor: pointer; }
    .ds-check, .ds-radio { display: inline-flex; align-items: center; gap: var(--spacer-8); min-height: 40px; font-size: var(--body-base-font-size); color: var(--text-default); cursor: pointer; user-select: none; }
    .ds-check__box { width: 16px; height: 16px; border: 1px solid var(--border-neutral-l2); background: var(--bg-base-default); border-radius: var(--radius-4); display: inline-flex; align-items: center; justify-content: center; color: var(--text-onbrand); transition: background .12s, border-color .12s; }
    .ds-check input { display: none; }
    .ds-check input:checked + .ds-check__box { background: var(--bg-brand); border-color: var(--bg-brand); }
    .ds-check input:checked + .ds-check__box::after { content: ''; width: 8px; height: 4px; border-left: 2px solid var(--text-onbrand); border-bottom: 2px solid var(--text-onbrand); transform: rotate(-45deg) translate(1px, -1px); }
    .ds-check input:disabled + .ds-check__box { opacity: .5; cursor: not-allowed; }
    .ds-radio__dot { width: 16px; height: 16px; border: 1px solid var(--border-neutral-l2); background: var(--bg-base-default); border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; }
    .ds-radio input { display: none; }
    .ds-radio input:checked + .ds-radio__dot { border-color: var(--bg-brand); }
    .ds-radio input:checked + .ds-radio__dot::after { content: ''; width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--bg-brand); }
    .ds-switch { position: relative; display: inline-flex; width: 32px; height: 18px; background: var(--bg-overlay-l3); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-full); cursor: pointer; transition: background .15s, border-color .15s; }
    .ds-switch input { display: none; }
    .ds-switch__thumb { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--bg-base-default); border-radius: var(--radius-full); transition: left .15s, background .15s; }
    .ds-switch input:checked ~ .ds-switch__thumb { left: 16px; background: var(--icon-onbrand); }
    .ds-switch:has(input:checked) { background: var(--bg-brand); border-color: var(--bg-brand); }
    .input-affix { color: var(--text-tertiary); font-family: var(--body-base-font-family); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); white-space: nowrap; }
    .ds-date-input { position: relative; }
    .ds-date-input input { padding-right: var(--spacer-32); }
    .ds-date-input input::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
    .ds-date-input .icon-img { position: absolute; top: 50%; right: var(--spacer-12); transform: translateY(-50%); color: var(--icon-secondary); pointer-events: none; }
    .starsurvey-date-picker {
        position: fixed;
        z-index: var(--shell-z-picker);
        width: 320px;
        padding: var(--spacer-12);
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-12);
        background: var(--bg-base-default);
        box-shadow: 0 24px 64px color-mix(in srgb, var(--text-default) 14%, transparent), 0 4px 16px color-mix(in srgb, var(--text-default) 8%, transparent);
        color: var(--text-default);
        backdrop-filter: blur(14px);
    }
    .starsurvey-date-picker[hidden] { display: none !important; }
    .starsurvey-date-picker__head {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr) 32px;
        align-items: center;
        gap: var(--spacer-8);
        margin-bottom: var(--spacer-12);
    }
    .starsurvey-date-picker__title {
        color: var(--text-default);
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-align: center;
    }
    .starsurvey-date-picker__nav {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-full);
        background: var(--bg-base-default);
        color: var(--icon-secondary);
        cursor: pointer;
    }
    .starsurvey-date-picker__nav:hover {
        border-color: var(--border-contrast);
        color: var(--icon-default);
    }
    .starsurvey-date-picker__weekdays,
    .starsurvey-date-picker__grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
    }
    .starsurvey-date-picker__weekdays {
        margin-bottom: var(--spacer-8);
    }
    .starsurvey-date-picker__weekday {
        display: grid;
        place-items: center;
        min-height: 24px;
        color: var(--text-tertiary);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .starsurvey-date-picker__day {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 0;
        border: 1px solid transparent;
        border-radius: var(--radius-8);
        background: transparent;
        color: var(--text-default);
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }
    .starsurvey-date-picker__day:hover {
        background: var(--bg-overlay-l2);
    }
    .starsurvey-date-picker__day.is-outside {
        color: var(--text-tertiary);
        font-weight: 500;
    }
    .starsurvey-date-picker__day.is-today {
        border-color: color-mix(in srgb, var(--border-brand) 45%, transparent);
    }
    .starsurvey-date-picker__day.is-selected {
        background: var(--bg-brand);
        color: var(--text-onbrand);
    }
    .starsurvey-date-picker__day.is-selected:hover {
        background: var(--bg-brand);
    }
    .starsurvey-date-picker__time {
        display: grid;
        gap: var(--spacer-8);
        margin-top: var(--spacer-12);
        padding-top: var(--spacer-12);
        border-top: 1px solid var(--border-neutral-l1);
    }
    .starsurvey-date-picker__time[hidden] {
        display: none !important;
    }
    .starsurvey-date-picker__time-label {
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .starsurvey-date-picker__time-select {
        width: 100%;
        min-height: 36px;
        padding: 0 var(--spacer-12);
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-8);
        background: var(--bg-base-default);
        color: var(--text-default);
        font: inherit;
        font-size: 13px;
        font-weight: 600;
    }
    .starsurvey-date-picker__time-select:focus-visible {
        outline: 2px solid color-mix(in srgb, var(--border-brand) 55%, transparent);
        outline-offset: 1px;
    }
    .starsurvey-date-picker__tbc {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--spacer-8);
        width: 100%;
        min-height: 36px;
        padding: 0 var(--spacer-12);
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-8);
        background: var(--bg-base-default);
        color: var(--text-default);
        font: inherit;
        font-size: 13px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }
    .starsurvey-date-picker__tbc span {
        color: var(--text-tertiary);
        font-size: 11px;
        font-weight: 500;
    }
    .starsurvey-date-picker__tbc:hover {
        border-color: var(--border-brand);
    }
    .starsurvey-date-picker__tbc.is-selected {
        border-color: var(--border-brand);
        background: color-mix(in srgb, var(--bg-brand) 14%, var(--bg-base-default));
        color: var(--text-brand, var(--text-default));
    }
    .starsurvey-date-picker__tbc:focus-visible {
        outline: 2px solid color-mix(in srgb, var(--border-brand) 55%, transparent);
        outline-offset: 1px;
    }
    .starsurvey-date-picker__footer {
        display: flex;
        justify-content: flex-end;
        gap: var(--spacer-8);
        margin-top: var(--spacer-12);
        padding-top: var(--spacer-12);
        border-top: 1px solid var(--border-neutral-l1);
    }
    .starsurvey-date-picker__footer[hidden] {
        display: none !important;
    }
    .starsurvey-date-picker__footer .btn:disabled,
.starsurvey-date-picker__footer .ds-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }
    [data-theme="dark"] .starsurvey-date-picker__time-select {
        background: var(--bg-base-default);
        border-color: var(--border-neutral-l1);
        color: var(--text-default);
    }

    .time-input-wrap {
        display: flex;
        align-items: center;
        gap: var(--spacer-8, 8px);
    }
    .time-input-wrap__trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        border-radius: var(--radius-8, 8px);
        background: transparent;
        color: var(--icon-secondary, var(--text-secondary));
        cursor: pointer;
        flex-shrink: 0;
    }
    .time-input-wrap__trigger i {
        font-size: 18px;
        line-height: 1;
    }
    .time-input-wrap__trigger:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }
    .time-input-wrap:focus-within .time-input-wrap__trigger {
        color: var(--icon-brand, var(--text-brand, #2563eb));
    }
    .time-input__field {
        min-width: 0;
        flex: 1 1 auto;
    }

    .starsurvey-time-picker {
        position: fixed;
        z-index: var(--shell-z-picker);
        width: 280px;
        padding: var(--spacer-12, 12px);
        border: 1px solid var(--border-neutral-l1, var(--border-subtle));
        border-radius: var(--radius-12, 12px);
        background: var(--bg-base-default, var(--bg-surface));
        box-shadow: 0 24px 64px color-mix(in srgb, var(--text-default) 14%, transparent), 0 4px 16px color-mix(in srgb, var(--text-default) 8%, transparent);
        color: var(--text-default);
        backdrop-filter: blur(14px);
    }
    .starsurvey-time-picker[hidden] {
        display: none !important;
    }
    .starsurvey-time-picker__columns {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0;
        border: 1px solid var(--border-neutral-l1, var(--border-subtle));
        border-radius: var(--radius-8, 8px);
        overflow: hidden;
        background: var(--bg-base-default, var(--bg-surface));
    }
    .starsurvey-time-picker__column {
        max-height: 220px;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-right: 1px solid var(--border-neutral-l1, var(--border-subtle));
        -webkit-overflow-scrolling: touch;
    }
    .starsurvey-time-picker__column:last-child {
        border-right: 0;
    }
    .starsurvey-time-picker__option {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 36px;
        padding: 6px 8px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--text-default);
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }
    .starsurvey-time-picker__option:hover {
        background: color-mix(in srgb, var(--bg-brand, #2563eb) 8%, transparent);
    }
    .starsurvey-time-picker__option.is-selected {
        background: var(--bg-brand, #2563eb);
        color: var(--text-onbrand, #fff);
    }
    .starsurvey-time-picker__option.is-selected:hover {
        background: var(--bg-brand, #2563eb);
        color: var(--text-onbrand, #fff);
    }
    .starsurvey-time-picker__footer {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: var(--spacer-8, 8px);
        margin-top: var(--spacer-12, 12px);
        padding-top: var(--spacer-12, 12px);
        border-top: 1px solid var(--border-neutral-l1, var(--border-subtle));
    }
    .starsurvey-time-picker__footer .ds-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }
    [data-theme="dark"] .starsurvey-time-picker__columns,
    [data-theme="dark"] .starsurvey-time-picker {
        background: var(--bg-base-default, var(--bg-surface));
        border-color: var(--border-neutral-l1, var(--border-subtle));
    }

    .color-input-wrap__trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-full);
        background: transparent;
        cursor: pointer;
        flex-shrink: 0;
    }
    .color-input-wrap__trigger:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }
    .color-input-wrap__swatch {
        display: block;
        width: 20px;
        height: 20px;
        border-radius: var(--radius-full);
        background: var(--client-brand-color, var(--bg-overlay-l3));
        border: 1px solid color-mix(in srgb, var(--client-brand-color, var(--border-subtle)) 35%, var(--border-subtle));
        box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 18%, transparent);
    }
    .color-input__field {
        font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .starsurvey-color-picker {
        position: fixed;
        z-index: var(--shell-z-picker);
        width: 320px;
        padding: var(--spacer-12);
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-12);
        background: var(--bg-base-default);
        box-shadow: 0 24px 64px color-mix(in srgb, var(--text-default) 14%, transparent), 0 4px 16px color-mix(in srgb, var(--text-default) 8%, transparent);
        color: var(--text-default);
        backdrop-filter: blur(14px);
        display: grid;
        gap: var(--spacer-12);
    }
    .starsurvey-color-picker[hidden] { display: none !important; }
    .starsurvey-color-picker__section {
        display: grid;
        gap: var(--spacer-8);
    }
    .starsurvey-color-picker__label {
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .starsurvey-color-picker__presets {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: var(--spacer-8);
    }
    .starsurvey-color-picker__preset {
        width: 100%;
        aspect-ratio: 1;
        border: 2px solid transparent;
        border-radius: var(--radius-full);
        background: var(--client-brand-color, var(--bg-overlay-l3));
        box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 16%, transparent);
        cursor: pointer;
        padding: 0;
    }
    .starsurvey-color-picker__preset:hover {
        transform: scale(1.04);
    }
    .starsurvey-color-picker__preset.is-selected {
        border-color: var(--text-default);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg-brand) 35%, transparent);
    }
    .starsurvey-color-picker__custom {
        display: grid;
        gap: var(--spacer-10);
    }
    .starsurvey-color-picker__sv {
        position: relative;
        width: 100%;
        height: 160px;
        border-radius: var(--radius-10);
        border: 1px solid var(--border-subtle);
        background:
            linear-gradient(to top, #000, transparent),
            linear-gradient(to right, #fff, var(--color-picker-hue, #4B3FE3));
        cursor: crosshair;
        touch-action: none;
        outline: none;
    }
    .starsurvey-color-picker__sv-thumb {
        position: absolute;
        width: 14px;
        height: 14px;
        border: 2px solid #fff;
        border-radius: var(--radius-full);
        box-shadow: 0 0 0 1px color-mix(in srgb, #000 45%, transparent);
        transform: translate(-50%, -50%);
        pointer-events: none;
    }
    .starsurvey-color-picker__controls {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: var(--spacer-10);
        align-items: center;
    }
    .starsurvey-color-picker__preview {
        width: 28px;
        height: 28px;
        border-radius: var(--radius-full);
        background: var(--client-brand-color, var(--bg-overlay-l3));
        border: 1px solid var(--border-subtle);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 18%, transparent);
    }
    .starsurvey-color-picker__hue-label {
        display: block;
        min-width: 0;
    }
    .starsurvey-color-picker__hue {
        width: 100%;
        height: 14px;
        appearance: none;
        border-radius: var(--radius-full);
        background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
        outline: none;
        cursor: pointer;
    }
    .starsurvey-color-picker__hue::-webkit-slider-thumb {
        appearance: none;
        width: 16px;
        height: 16px;
        border-radius: var(--radius-full);
        border: 2px solid #fff;
        background: var(--bg-surface);
        box-shadow: 0 0 0 1px color-mix(in srgb, #000 35%, transparent);
    }
    .starsurvey-color-picker__hue::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border-radius: var(--radius-full);
        border: 2px solid #fff;
        background: var(--bg-surface);
        box-shadow: 0 0 0 1px color-mix(in srgb, #000 35%, transparent);
    }
    .starsurvey-color-picker__hex-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: var(--spacer-8);
        align-items: center;
    }
    .starsurvey-color-picker__hex-label {
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 600;
    }
    .starsurvey-color-picker__hex {
        min-width: 0;
        height: var(--toolbar-control-height, 36px);
        padding: 0 var(--spacer-10);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-8);
        background: var(--bg-surface);
        color: var(--text-main);
        font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
        text-transform: uppercase;
    }
    [data-theme="dark"] .starsurvey-color-picker {
        background: var(--bg-base-default);
        border-color: var(--border-neutral-l1);
    }

    .tag-field { display: flex; align-items: center; flex-wrap: wrap; gap: var(--spacer-6); min-height: 32px; padding: var(--spacer-4) var(--spacer-8); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-8); background: var(--bg-base-default); }
    .tag-field:focus-within { border-color: var(--border-contrast); }
    .tag-remove { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--icon-tertiary); cursor: pointer; border-radius: var(--radius-4); }
    .tag-remove:hover { background: var(--bg-overlay-l2); color: var(--icon-default); }
    .stepper { display: inline-flex; align-items: center; width: fit-content; border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-8); overflow: hidden; background: var(--bg-base-default); }
    .stepper button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--icon-secondary); cursor: pointer; }
    .stepper button:hover { background: var(--bg-overlay-l2); color: var(--icon-default); }
    .stepper input { width: 48px; height: 32px; padding: 0; border: 0; border-left: 1px solid var(--border-neutral-l1); border-right: 1px solid var(--border-neutral-l1); background: transparent; color: var(--text-default); text-align: center; font: inherit; line-height: var(--body-base-line-height); appearance: textfield; -moz-appearance: textfield; }
    .stepper input::-webkit-outer-spin-button,
    .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* â”€â”€ Menu â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Menu ===== */
    .ds-menu { display: flex; flex-direction: column; gap: var(--spacer-2); background: var(--bg-menu); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-12); padding: var(--spacer-8); min-width: 180px; color: var(--text-default); box-shadow: 0 12px 32px color-mix(in srgb, var(--text-default) 12%, transparent), 0 2px 8px color-mix(in srgb, var(--text-default) 8%, transparent); }
    .ds-menu__item { display: flex; align-items: center; gap: var(--spacer-8); min-height: 32px; padding: var(--spacer-6) var(--spacer-8); border-radius: var(--radius-8); color: var(--text-default); font-family: var(--body-base-font-family); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); font-weight: var(--body-base-font-weight); cursor: pointer; }
    .ds-menu__item .icon { color: var(--icon-secondary); }
    .ds-menu__icon { width: 16px; height: 16px; flex: 0 0 auto; object-fit: contain; }
    .ds-menu__item:hover { background: var(--bg-overlay-l2); }
    .ds-menu__item--danger { color: var(--status-error-default); }
    .ds-menu__item--danger .icon,
    .ds-menu__item--danger .ds-menu__icon { color: var(--status-error-default); }
    .ds-menu__divider { height: 1px; background: var(--border-neutral-l1); margin: var(--spacer-4) 0; }
    .ds-menu__shortcut { margin-left: auto; color: var(--text-tertiary); font-family: var(--body-md-font-family); font-size: var(--body-md-font-size); line-height: var(--body-md-line-height); font-weight: var(--body-md-font-weight); font-variant-numeric: normal; font-feature-settings: normal; }
    .ds-keybind { display: inline-flex; align-items: center; justify-content: center; gap: var(--spacer-2); min-height: 22px; padding: 0 var(--spacer-6); border: 1px solid var(--border-neutral-l1); border-radius: var(--radius-8); background: var(--bg-overlay-l1); color: var(--text-tertiary); font-family: var(--body-md-font-family); font-size: var(--body-md-font-size); line-height: 1.2; font-weight: var(--font-weight-medium); letter-spacing: 0.02em; white-space: nowrap; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--text-default) 6%, transparent); }
    .ds-keybind__separator { opacity: 0.72; }
    .ds-keybind--button { margin-left: var(--spacer-8); flex: 0 0 auto; }
    .ds-keybind__part--label {
        margin-left: var(--spacer-4);
        letter-spacing: 0.01em;
    }
    .ds-btn--brand .ds-keybind--button,
    .btn-primary .ds-keybind--button,
    .ds-btn--primary .ds-keybind--button,
    .ds-btn--warning .ds-keybind--button,
    .btn-warning .ds-keybind--button,
    .ds-btn--danger .ds-keybind--button,
    .ds-btn--danger-strong .ds-keybind--button,
    .btn-danger .ds-keybind--button {
        color: var(--text-onbrand);
        background: color-mix(in srgb, var(--text-white) 16%, transparent);
        border-color: color-mix(in srgb, var(--text-white) 28%, transparent);
        box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--text-white) 10%, transparent);
    }
    .ds-keybind--menu { margin-left: auto; flex: 0 0 auto; }
    .ds-menu__item .ds-keybind--menu,
    .keyboard-shortcuts__item .ds-keybind--menu { margin-left: auto; }
    .ds-menu__group-label { padding: var(--spacer-8); color: var(--text-tertiary); font-family: var(--body-md-font-family); font-size: var(--body-md-font-size); line-height: var(--body-md-line-height); font-weight: var(--body-md-font-weight); letter-spacing: var(--body-md-letter-spacing); text-transform: uppercase; }
    .ds-popover .ds-menu { border: 0; padding: 0; box-shadow: none; }

/* â”€â”€ Pagination â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Pagination ===== */
    .ds-pagination { display: inline-flex; gap: var(--spacer-4); align-items: center; }
    .ds-pagination__item {
        min-width: 32px;
        height: var(--toolbar-control-height, 40px);
        padding: 0 var(--spacer-10);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-base-default);
        color: var(--text-secondary);
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-8);
        font: inherit;
        font-size: var(--body-sm-font-size);
        line-height: 1;
        cursor: pointer;
        transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    }
    .ds-pagination__item:hover:not([disabled]) { background: var(--bg-overlay-l2); color: var(--text-default); border-color: var(--border-neutral-l2); }
    .ds-pagination__item.is-active {
        background: var(--bg-overlay-l3);
        color: var(--text-default);
        border-color: var(--border-neutral-l2);
        font-weight: 600;
    }
    .ds-pagination__item[disabled] { opacity: .45; cursor: not-allowed; }
    .ds-pagination__item--nav { min-width: auto; padding-inline: var(--spacer-12); white-space: nowrap; }
    .ds-pagination__range {
        margin: 0;
        color: var(--text-tertiary);
        font-family: var(--body-sm-font-family);
        font-size: var(--body-sm-font-size);
        line-height: var(--body-sm-line-height);
        font-weight: var(--body-sm-font-weight);
        letter-spacing: var(--body-sm-letter-spacing);
        white-space: nowrap;
    }
    .ds-pagination__ellipsis {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        color: var(--text-tertiary);
        font-size: var(--body-sm-font-size);
        user-select: none;
    }

/* ===== Directory pagination (shared list footers) ===== */
    .directory-pagination:not([hidden]) {
        margin-top: var(--spacer-8);
        padding-top: var(--spacer-12);
        border-top: 1px solid var(--border-neutral-l1);
    }

    .directory-pagination__bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        column-gap: var(--spacer-16);
        row-gap: var(--spacer-12);
    }

    .directory-pagination__summary {
        min-width: 0;
    }

    .directory-pagination__size {
        display: inline-flex;
        align-items: center;
        gap: var(--spacer-8);
        margin: 0;
        white-space: nowrap;
    }

    .directory-pagination__size-label {
        color: var(--text-tertiary);
        font-family: var(--body-sm-font-family);
        font-size: var(--body-sm-font-size);
        line-height: var(--body-sm-line-height);
        font-weight: var(--body-sm-font-weight);
        letter-spacing: var(--body-sm-letter-spacing);
    }

    .directory-pagination__size-select {
        height: var(--toolbar-control-height, 40px);
        min-width: 4.5rem;
        padding: 0 var(--spacer-32) 0 var(--spacer-12);
        background-color: var(--bg-base-default);
        color: var(--text-default);
        border: 1px solid var(--border-neutral-l1);
        border-radius: var(--radius-8);
        font: inherit;
        font-size: var(--body-sm-font-size);
        cursor: pointer;
    }

    .directory-pagination__size-select:focus-visible {
        outline: 2px solid var(--focus-ring, var(--brand-primary));
        outline-offset: 2px;
    }

    .directory-pagination__nav {
        display: inline-flex;
        align-items: center;
        gap: var(--spacer-4);
        justify-self: end;
    }

    .directory-pagination__pages {
        display: inline-flex;
        gap: var(--spacer-4);
        align-items: center;
    }

    .directory-pagination__compact-label { display: none; }

    .directory-pagination[hidden] { display: none !important; }

    @media (max-width: 899px) {
        .directory-pagination__bar {
            grid-template-columns: minmax(0, 1fr) auto;
            grid-template-rows: auto auto;
        }

        .directory-pagination__summary {
            grid-column: 1;
            grid-row: 1;
            align-self: center;
        }

        .directory-pagination__size {
            grid-column: 2;
            grid-row: 1;
            justify-self: end;
        }

        .directory-pagination__nav {
            grid-column: 1 / -1;
            grid-row: 2;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
            align-items: center;
            width: 100%;
            gap: var(--spacer-8);
        }

        .directory-pagination__nav .ds-pagination__item--nav:first-of-type {
            justify-self: start;
        }

        .directory-pagination__compact-label {
            display: inline;
            justify-self: center;
            text-align: center;
        }

        .directory-pagination__nav .ds-pagination__item--nav:last-of-type {
            justify-self: end;
        }

        .directory-pagination__pages { display: none; }
    }

    @media (max-width: 479px) {
        .directory-pagination__size-label {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .directory-pagination__size-select {
            min-width: 3.75rem;
        }

        .ds-pagination__item--nav {
            padding-inline: var(--spacer-10);
            font-size: var(--body-sm-font-size);
        }
    }

/* â”€â”€ Progress â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Progress ===== */
    .ds-progress { height: 6px; background: var(--bg-overlay-l2); border-radius: var(--radius-full); overflow: hidden; }
    .ds-progress__bar { height: 100%; background: var(--text-default); border-radius: inherit; }
    .ds-progress--brand .ds-progress__bar { background: var(--bg-brand); }

/* â”€â”€ Skeleton â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Skeleton ===== */
    .ds-skeleton { display: block; background: var(--bg-overlay-l2); border-radius: var(--radius-8); position: relative; overflow: hidden; }
    .ds-skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--bg-overlay-l3), transparent); animation: ds-skeleton-shine 1.6s ease-in-out infinite; }
    @keyframes ds-skeleton-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
    .ds-skeleton--line { height: 12px; }
    .ds-skeleton--title { height: 18px; width: 50%; }
    .ds-skeleton--circle { width: 32px; height: 32px; border-radius: var(--radius-full); }

/* â”€â”€ Table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Table ===== */
    .ds-table-card { overflow-x: auto; }
    .ds-table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; }
    .ds-table--fixed { table-layout: fixed; }
    .ds-table__col-member { width: 42%; }
    .ds-table__col-role { width: 16%; }
    .ds-table__col-active { width: 20%; }
    .ds-table__col-status { width: 16%; }
    .ds-table__col-actions { width: 6%; }
    .ds-table th, .ds-table td { text-align: left; vertical-align: middle; padding: var(--spacer-16) var(--spacer-8); border-bottom: 1px solid var(--border-neutral-l1); font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); }
    .ds-table th { padding-top: var(--spacer-8); padding-bottom: var(--spacer-12); color: var(--text-tertiary); font-weight: var(--font-weight-medium); font-size: var(--body-md-font-size); line-height: var(--body-md-line-height); text-transform: uppercase; letter-spacing: var(--body-md-letter-spacing); background: transparent; }
    .ds-table td { color: var(--text-secondary); }
    .ds-table td:first-child { color: var(--text-default); }
    .ds-table tr:last-child td { border-bottom: none; }
    .ds-table td.num,
    .ds-table th.num { text-align: right; font-family: var(--code-editor-font-family); font-variant-numeric: tabular-nums; }
    .ds-table__member { display: flex; align-items: center; gap: var(--spacer-16); min-width: 0; }
    .ds-table__member-meta { display: flex; flex-direction: column; gap: var(--spacer-2); min-width: 0; }
    .ds-table__member-name { color: var(--text-default); font-weight: var(--font-weight-medium); white-space: nowrap; }
    .ds-table__member-email { color: var(--text-tertiary); font-size: var(--body-md-font-size); line-height: var(--body-md-line-height); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ds-table td.ds-table__actions { width: 1%; text-align: right; }
    .ds-table td .action-bar-inline,
    .data-table td .action-bar-inline {
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
        margin-top: 0;
        padding-top: 0;
        vertical-align: middle;
    }
    .ds-table td.ds-table__actions .action-bar-inline {
        justify-content: flex-end;
    }

/* Rounded shells pass corner radius to header cells so backgrounds fill curved edges. */
.ds-table-card,
.table-responsive,
.dashboard-activity-table-scroll,
.planning-excel-view__table-wrap,
.glass-panel.p-0 {
    --table-shell-radius: var(--radius-lg);
}

.dashboard-activity-table-scroll,
.planning-excel-view__table-wrap,
.glass-panel.p-0 {
    --table-shell-radius: calc(var(--radius-xl) - 1px);
}

.ds-table,
.data-table,
.dashboard-activity-table,
.planning-excel-table {
    border-collapse: separate;
    border-spacing: 0;
}

.ds-table thead tr:first-child > :first-child,
.data-table thead tr:first-child > :first-child,
.dashboard-activity-table thead tr:first-child > :first-child,
.planning-excel-table thead tr:first-child > :first-child {
    border-top-left-radius: var(--table-shell-radius, 0);
}

.ds-table thead tr:first-child > :last-child,
.data-table thead tr:first-child > :last-child,
.dashboard-activity-table thead tr:first-child > :last-child,
.planning-excel-table thead tr:first-child > :last-child {
    border-top-right-radius: var(--table-shell-radius, 0);
}

.glass-panel.p-0 {
    overflow: hidden;
}

.data-table thead th {
    vertical-align: middle;
}

.data-table-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.data-table-sort-button:hover,
.data-table-sort-button.is-active {
    color: var(--text-main);
}

.data-table-sort-button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-brand, #2563eb) 55%, transparent);
    outline-offset: 2px;
    border-radius: 6px;
}

.data-table-sort-button__label {
    min-width: 0;
    text-align: left;
}

.data-table-sort-button__icon {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.data-table-sort-button.is-active .data-table-sort-button__icon {
    color: var(--color-brand, #2563eb);
}

[data-theme="dark"] .data-table-sort-button.is-active .data-table-sort-button__icon {
    color: var(--text-brand);
}

#systemFeedbackPhasesTable.data-table--resizable {
    table-layout: fixed;
    width: max-content;
    min-width: 1360px;
}

#systemFeedbackPhasesTable.data-table--resizable th {
    position: relative;
    overflow: hidden;
}

#systemFeedbackPhasesTable.data-table--resizable th,
#systemFeedbackPhasesTable.data-table--resizable td {
    vertical-align: middle;
}

#systemFeedbackPhasesTable.data-table--resizable td {
    overflow: hidden;
}

.data-table-col-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    z-index: 2;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
}

.data-table-col-resizer::after {
    content: '';
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 50%;
    width: 2px;
    border-radius: 999px;
    background: transparent;
    transform: translateX(-50%);
    transition: background var(--transition-fast);
}

.data-table-col-resizer:hover::after,
.data-table-col-resizer.is-active::after {
    background: color-mix(in srgb, var(--color-brand, #2563eb) 55%, transparent);
}

body.is-column-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}

body.is-column-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

/* ===== Tabs ===== */
    .ds-tabs { display: flex; gap: var(--spacer-24); border-bottom: 1px solid var(--border-neutral-l1); }
    .ds-tab { display: inline-flex; align-items: center; padding: var(--spacer-12) 0; background: transparent; border: none; color: var(--text-tertiary); cursor: pointer; font: inherit; font-size: var(--body-base-font-size); line-height: var(--body-base-line-height); font-weight: var(--font-weight-medium); position: relative; }
    .ds-tab:hover { color: var(--text-default); }
    .ds-tab.is-active { color: var(--text-default); }
    .ds-tab.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--icon-default); }
    .ds-tab__count,
    .ds-tab .ds-tag.num { margin-left: var(--spacer-6); min-width: 18px; height: 18px; padding: 0 var(--spacer-6); display: inline-grid; place-items: center; vertical-align: middle; border: none; border-radius: var(--radius-full); background: var(--bg-overlay-l2); color: var(--text-tertiary); font-family: var(--font-family-metric); font-size: var(--body-xs-font-size); line-height: var(--body-xs-line-height); font-weight: var(--body-xs-font-weight); font-variant-numeric: tabular-nums; }

/* â”€â”€ Tag â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ===== Tag / Badge ===== */
    .ds-tag { display: inline-flex; align-items: center; gap: var(--spacer-4); height: 22px; padding: 0 var(--spacer-8); border-radius: var(--radius-8); font-size: var(--body-sm-font-size); line-height: var(--body-sm-line-height); background: var(--bg-overlay-l2); color: var(--text-secondary); border: 1px solid var(--border-neutral-l1); }
    .ds-tag .icon { width: 12px; height: 12px; }
    .ds-tag--brand { background: var(--bg-brand-popup); color: var(--text-brand); }
    .ds-tag--success { background: var(--status-success-surface-l1); color: var(--status-success-default); }
    .ds-tag--warning { background: var(--status-warning-surface-l1); color: var(--status-warning-default); }
    .ds-tag--danger { background: var(--status-error-surface-l1); color: var(--status-error-default); }

/* Starsurvey custom styles */

/* Starsurvey - TRAE Work aligned operational UI */

:root {
    --bg-base: var(--bg-base-secondary);
    --bg-surface: var(--bg-base-default);
    --bg-surface-secondary: var(--bg-overlay-l1);
    --bg-surface-hover: var(--bg-overlay-l2);
    --bg-brand-soft: var(--bg-brand-popup);
    --bg-brand-strong: var(--bg-brand);
    --bg-brand-strong-hover: var(--bg-brand-hover);
    --bg-brand-strong-active: var(--bg-brand-active);
    --bg-neutral-strong: var(--bg-invert);
    --bg-neutral-soft: var(--bg-overlay-l1);
    --bg-overlay: color-mix(in srgb, var(--text-default) 42%, transparent);

    --text-main: var(--text-default);
    --text-primary: var(--text-default);
    --text-muted: var(--text-tertiary);
    --text-inverse: var(--text-white);
    --text-brand: var(--bg-brand);
    --text-secondary: var(--text-tertiary);

    --border-subtle: var(--border-neutral-l1);
    --border-default: var(--border-neutral-l2);
    --border-strong: var(--border-neutral-l3);
    --border-brand: var(--bg-brand);

    --status-info: var(--bg-brand);
    --status-info-soft: var(--bg-brand-popup);
    --status-success: var(--status-success-default);
    --status-success-soft: var(--status-success-surface-l1);
    --status-warning: var(--status-warning-default);
    --status-warning-soft: var(--status-warning-surface-l1);
    --status-danger: var(--status-error-default);
    --status-danger-soft: var(--status-error-surface-l1);

    /* Job execution states — orange / blue / green / red */
    --job-status-scheduled: var(--status-warning-default);
    --job-status-scheduled-soft: var(--status-warning-surface-l1);
    --job-status-in-progress: var(--status-primary-default);
    --job-status-in-progress-soft: var(--status-primary-surface-l1);
    --job-status-completed: var(--status-success-default);
    --job-status-completed-soft: var(--status-success-surface-l1);
    --job-status-report-received: var(--status-info);
    --job-status-report-received-soft: var(--status-info-soft);
    --job-status-report-uploaded: var(--status-info);
    --job-status-report-uploaded-soft: var(--status-info-soft);
    --job-status-report-checked: var(--status-primary-default);
    --job-status-report-checked-soft: var(--status-primary-surface-l1);
    --job-status-approved: var(--status-success-default);
    --job-status-approved-soft: var(--status-success-surface-l1);
    --job-status-closed: var(--text-secondary);
    --job-status-closed-soft: var(--bg-overlay-l1);
    --job-status-issue: var(--status-error-default);
    --job-status-issue-soft: var(--status-error-surface-l1);
    --job-status-invoiced: var(--status-info);
    --job-status-invoiced-soft: var(--status-info-soft);

    --surface-muted: var(--bg-overlay-l1);
    --surface-elevated: var(--bg-surface);

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    --space-2: 2px;
    --space-4: 4px;
    --space-6: 6px;
    --space-8: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-14: 14px;
    --space-16: 16px;
    --space-18: 18px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    --space-40: 40px;

    --shadow-sm: 0 4px 12px color-mix(in srgb, var(--text-default) 6%, transparent);
    --shadow-md: 0 12px 28px color-mix(in srgb, var(--text-default) 10%, transparent);
    --shadow-lg: 0 24px 56px color-mix(in srgb, var(--text-default) 16%, transparent);

    --sidebar-width: 272px;
    --font-body: var(--body-base-font-family), "Inter", system-ui, sans-serif;
    --font-heading: var(--heading-md-font-family), var(--body-base-font-family), "Inter", system-ui, sans-serif;
    --font-mono: var(--code-editor-font-family), ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --transition-fast: 0.18s ease;
    --transition-base: 0.24s ease;

    color-scheme: only light;
}

/*
 * Dark mode: readable charcoal shell (not OLED crush).
 * Absolute semantic aliases below — do not leave --text-main / --text-muted
 * as light-mode var() chains that can resolve to dark-on-dark on phones.
 */
[data-theme="dark"] {
    --bg-base-default: #2f3036;
    --bg-base-secondary: #222328;
    --bg-base-tertiary: #3c3d45;
    --bg-overlay-l1: rgba(255, 255, 255, 0.10);
    --bg-overlay-l2: rgba(255, 255, 255, 0.14);
    --bg-overlay-l3: rgba(255, 255, 255, 0.20);
    --bg-overlay-l4: rgba(255, 255, 255, 0.26);
    --bg-white: #2f3036;
    --bg-menu: #35363d;
    --bg-tooltip: #3c3d45;
    --bg-invert: #f5f5f7;
    --bg-invert-hover: #ffffff;
    --bg-invert-active: #e4e4e7;
    --bg-invert-disabled: rgba(255, 255, 255, 0.18);

    --bg-brand: #6a6fff;
    --bg-brand-hover: #8894ff;
    --bg-brand-active: #4b3fe3;
    --bg-brand-disabled: rgba(106, 111, 255, 0.32);
    --bg-brand-popup: rgba(136, 148, 255, 0.32);

    --text-default: #f5f5f7;
    --text-default-hover: #ffffff;
    --text-default-active: #ffffff;
    --text-secondary: #e4e4e7;
    --text-secondary-hover: #f5f5f7;
    --text-secondary-active: #f5f5f7;
    --text-tertiary: #d4d4d8;
    --text-disabled: #a1a1aa;
    --text-brand: #c4c8ff;
    --text-brand-hover: #dde0ff;
    --text-onbrand: #ffffff;
    --text-onaccent: #ffffff;
    --text-white: #ffffff;

    /* Semantic aliases — explicit so muted/main never inherit light-mode ink */
    --text-main: #f5f5f7;
    --text-primary: #f5f5f7;
    --text-muted: #d4d4d8;
    --text-inverse: #ffffff;

    --color-foreground: #f5f5f7;
    --color-foreground-hover: #ffffff;
    --color-on-surface: #f5f5f7;
    --color-on-surface-variant: #e4e4e7;
    --color-muted-foreground: #d4d4d8;
    --color-disabled-foreground: #a1a1aa;
    --color-on-primary: #ffffff;

    --icon-default: #f5f5f7;
    --icon-default-hover: #ffffff;
    --icon-default-active: #ffffff;
    --icon-secondary: #e4e4e7;
    --icon-secondary-hover: #f5f5f7;
    --icon-secondary-active: #f5f5f7;
    --icon-tertiary: #d4d4d8;
    --icon-disabled: #a1a1aa;
    --icon-brand: #c4c8ff;
    --icon-brand-hover: #dde0ff;
    --icon-onbrand: #ffffff;
    --icon-white: #ffffff;

    --border-neutral-l1: rgba(255, 255, 255, 0.16);
    --border-neutral-l2: rgba(255, 255, 255, 0.24);
    --border-neutral-l3: rgba(255, 255, 255, 0.38);
    --border-contrast: #f5f5f7;
    --border-brand: #8894ff;

    --bg-surface: #2f3036;
    --bg-base: #222328;
    --bg-surface-secondary: rgba(255, 255, 255, 0.10);
    --bg-surface-hover: rgba(255, 255, 255, 0.14);
    --bg-brand-soft: rgba(136, 148, 255, 0.32);
    --bg-brand-strong: #6a6fff;
    --bg-brand-strong-hover: #8894ff;
    --bg-brand-strong-active: #4b3fe3;
    --bg-neutral-strong: #f5f5f7;
    --bg-neutral-soft: rgba(255, 255, 255, 0.10);
    --bg-overlay: color-mix(in srgb, #000 58%, transparent);

    --border-subtle: rgba(255, 255, 255, 0.16);
    --border-default: rgba(255, 255, 255, 0.24);
    --border-strong: rgba(255, 255, 255, 0.38);

    --surface-muted: rgba(255, 255, 255, 0.10);
    --surface-elevated: #2f3036;

    --shadow-sm: 0 4px 12px color-mix(in srgb, #000 28%, transparent);
    --shadow-md: 0 12px 28px color-mix(in srgb, #000 36%, transparent);
    --shadow-lg: 0 24px 56px color-mix(in srgb, #000 44%, transparent);

    --status-primary-surface-l1: rgba(47, 116, 255, 0.28);
    --status-primary-surface-l2: rgba(47, 116, 255, 0.36);
    --status-success-surface-l1: rgba(64, 176, 139, 0.28);
    --status-success-surface-l2: rgba(64, 176, 139, 0.36);
    --status-warning-surface-l1: rgba(226, 121, 0, 0.28);
    --status-warning-surface-l2: rgba(226, 121, 0, 0.36);
    --status-error-surface-l1: rgba(232, 70, 58, 0.28);
    --status-error-surface-l2: rgba(232, 70, 58, 0.36);

    --special-bgtabsoverlay: rgba(255, 255, 255, 0.12);
    --brand-logo-filter: brightness(0) invert(1);

    color-scheme: only dark;
    color: #f5f5f7;
    background-color: #222328;
}

[data-theme="dark"] body {
    color: #f5f5f7;
    background: var(--bg-base);
}

[data-theme="dark"] .page-header h1,
[data-theme="dark"] .page-header__content h1,
[data-theme="dark"] .topbar-action,
[data-theme="dark"] .topbar-action i,
[data-theme="dark"] .stat-info h3,
[data-theme="dark"] .stat-label,
[data-theme="dark"] .analytics-card__title,
[data-theme="dark"] .analytics-card__eyebrow {
    color: var(--text-main);
}

[data-theme="dark"] .page-header p,
[data-theme="dark"] .analytics-card__subtitle,
[data-theme="dark"] .stat-info span {
    color: var(--text-muted);
}

[data-theme="dark"] .ds-btn--brand,
[data-theme="dark"] .btn-primary {
    background: var(--bg-brand);
    border-color: var(--bg-brand);
    color: #ffffff;
}

[data-theme="dark"] .ds-btn--secondary,
[data-theme="dark"] .btn-secondary {
    color: var(--text-main);
    border-color: var(--border-default);
    background: color-mix(in srgb, var(--bg-surface) 88%, #fff 12%);
}

/*
 * Phones: browser/OS force-dark often leaves Light-theme ink on darkened surfaces.
 * When the app dark theme IS active, nail primary copy to near-white with !important
 * so mobile WebKit/Blink cannot keep mid-gray body text.
 */
@media (max-width: 899px) {
    [data-theme="dark"] body,
    [data-theme="dark"] .main-wrapper,
    [data-theme="dark"] .content-container,
    [data-theme="dark"] .view-section,
    [data-theme="dark"] .page-header,
    [data-theme="dark"] .page-header h1,
    [data-theme="dark"] .page-header__content,
    [data-theme="dark"] .analytics-card,
    [data-theme="dark"] .analytics-card__title,
    [data-theme="dark"] .analytics-card__eyebrow,
    [data-theme="dark"] .stat-info h3,
    [data-theme="dark"] .stat-label,
    [data-theme="dark"] .topbar-action,
    [data-theme="dark"] .topbar-action i,
    [data-theme="dark"] .app-header,
    [data-theme="dark"] .mobile-header-left,
    [data-theme="dark"] .sidebar,
    [data-theme="dark"] .nav-item,
    [data-theme="dark"] .page-tabs__tab {
        color: #f5f5f7 !important;
    }

    [data-theme="dark"] .page-header p,
    [data-theme="dark"] .analytics-card__subtitle,
    [data-theme="dark"] .stat-info span,
    [data-theme="dark"] .text-muted,
    [data-theme="dark"] .release-footer,
    [data-theme="dark"] .release-footer__copyright {
        color: #d4d4d8 !important;
    }

    [data-theme="dark"] .ds-btn--brand,
    [data-theme="dark"] .btn-primary {
        background: #6a6fff !important;
        border-color: #6a6fff !important;
        color: #ffffff !important;
    }

    [data-theme="dark"] .ds-btn--secondary,
    [data-theme="dark"] .btn-secondary {
        color: #f5f5f7 !important;
        border-color: rgba(255, 255, 255, 0.24) !important;
        background: #3a3b42 !important;
    }

    [data-theme="dark"] .analytics-card,
    [data-theme="dark"] .stat-card,
    [data-theme="dark"] .page-tabs,
    [data-theme="dark"] .glass-panel {
        background: #2f3036 !important;
        border-color: rgba(255, 255, 255, 0.16) !important;
    }
}

[data-theme="dark"] .auth-hero {
    color: var(--text-white);
    background:
        linear-gradient(135deg, color-mix(in srgb, #171717 92%, transparent), color-mix(in srgb, var(--bg-brand) 78%, #1f2937)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 32%);
}

[data-theme="dark"] .topbar-mobile-menu__backdrop,
[data-theme="dark"] .topbar-search-sheet__backdrop,
[data-theme="dark"] .page-header-mobile-sheet__backdrop,
[data-theme="dark"] .page-filters-shell.is-filter-sheet-open::before {
    background: color-mix(in srgb, #000 68%, transparent);
}

[data-theme="dark"] .topbar-mobile-menu__panel,
[data-theme="dark"] .topbar-search-sheet__panel,
[data-theme="dark"] .page-header-mobile-sheet__panel {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    box-shadow: 0 -12px 40px color-mix(in srgb, #000 42%, transparent);
}

@media (max-width: 720px) {
    [data-theme="dark"] .page-filters-panel:not([hidden]) {
        background: var(--bg-surface);
        border-color: var(--border-subtle);
        box-shadow: 0 -12px 40px color-mix(in srgb, #000 42%, transparent);
    }
}

[data-theme="dark"] .searchable-select-sheet__backdrop {
    background: color-mix(in srgb, #000 68%, transparent);
}

/*
 * Notification portal doubles as the mobile sheet backdrop. Idle/hidden must stay
 * fully transparent — otherwise a leftover full-viewport host veils dark mode.
 */
[data-theme="dark"] .topbar-notification-menu__portal,
[data-theme="dark"] .topbar-notification-menu__portal[hidden] {
    background: transparent !important;
}

[data-theme="dark"] body.is-notification-drawer-open .topbar-notification-menu__portal:not([hidden]),
[data-theme="dark"] .app-layout.is-notification-drawer-open .topbar-notification-menu__portal:not([hidden]) {
    background: color-mix(in srgb, #000 68%, transparent) !important;
}

[data-theme="dark"] .searchable-select-sheet__panel,
[data-theme="dark"] .topbar-notification-menu__drawer {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    box-shadow: 0 -12px 40px color-mix(in srgb, #000 42%, transparent);
}

[data-theme="dark"] .topbar-mobile-menu__item:hover,
[data-theme="dark"] .page-header-mobile-sheet__body .btn:hover,
[data-theme="dark"] .page-header-mobile-sheet__body .ds-btn:hover {
    background: var(--bg-neutral-soft);
}

[data-theme="dark"] .modal-overlay {
    background: color-mix(in srgb, #000 72%, var(--bg-surface) 28%);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .modal-body .action-bar-inline {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}

[data-theme="dark"] .ds-keybind {
    background: var(--bg-overlay-l2);
    border-color: var(--border-neutral-l2);
    color: var(--text-secondary);
}

[data-theme="dark"] .ds-btn--brand .ds-keybind--button,
[data-theme="dark"] .btn-primary .ds-keybind--button,
[data-theme="dark"] .ds-btn--primary .ds-keybind--button,
[data-theme="dark"] .ds-btn--warning .ds-keybind--button,
[data-theme="dark"] .btn-warning .ds-keybind--button,
[data-theme="dark"] .ds-btn--danger .ds-keybind--button,
[data-theme="dark"] .ds-btn--danger-strong .ds-keybind--button,
[data-theme="dark"] .btn-danger .ds-keybind--button {
    color: var(--text-onbrand);
    background: color-mix(in srgb, var(--text-white) 16%, transparent);
    border-color: color-mix(in srgb, var(--text-white) 28%, transparent);
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--text-white) 10%, transparent);
}

[data-theme="dark"] .keyboard-shortcuts__item {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}

/* ==========================================
   SECTION 2: Shared UI Components
   ========================================== */

.page-tabs {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--space-20);
    padding: var(--space-8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.page-tabs__viewport {
    flex: 1 1 auto;
    min-width: 0;
}

.page-tabs__track {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    width: 100%;
    min-width: 0;
}

.page-tabs__control {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}

.page-tabs__control[hidden] {
    display: none !important;
}

.page-tabs__control:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-tabs__control:not(:disabled):hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
    color: var(--text-main);
}

.page-tabs__control:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg-brand) 14%, transparent);
}

.page-tabs__tab {
    white-space: nowrap;
}

.page-tabs__tab.is-active {
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    border-color: color-mix(in srgb, var(--border-brand) 20%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-brand) 20%, transparent);
}

.page-tabs__tab.is-active:hover {
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    border-color: color-mix(in srgb, var(--border-brand) 20%, transparent);
}

.page-tabs__tab.is-active i {
    color: var(--text-brand);
}

.page-tabs--nested {
    margin: 0 0 0.75rem;
}

.page-tabs--nested .page-tabs__tab {
    font-size: 0.875rem;
    min-height: calc(var(--toolbar-control-height) - 4px);
}

.page-tabs__count {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--text-main) 8%, transparent);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.page-tab-panel[hidden],
[data-tab-panel][hidden] {
    display: none !important;
}

.settings-section-card.page-tab-panel[hidden] {
    display: none !important;
}

.ss-spinner {
    flex: 0 0 auto;
    display: inline-block;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--bg-brand-strong);
    animation: loadingSpin 0.8s linear infinite;
    vertical-align: middle;
}

.ss-spinner--sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.ss-spinner--md {
    width: 44px;
    height: 44px;
}

.ss-spinner--lg {
    width: 52px;
    height: 52px;
}

.is-control-busy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
}

.empty-state-card,
.loading-state-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-12);
    min-height: 180px;
    padding: var(--space-24);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--bg-brand) 2%, var(--bg-surface));
    text-align: center;
}

.loading-state-card--compact {
    min-height: 120px;
    padding: var(--space-16);
}

.empty-state-card__icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-brand-popup);
    color: var(--text-brand);
    font-size: 22px;
}

.empty-state-card h3,
.loading-state-card strong {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.empty-state-card p,
.loading-state-card span {
    max-width: 340px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.loading-state-card__spinner,
.loading-state-card .ss-spinner {
    margin: 0 auto;
}

.loading-state-card__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    align-items: center;
}

.system-migrations-panel.is-busy,
.system-health-performance-panel.is-busy,
[data-loading-panel].is-busy {
    opacity: 0.72;
    pointer-events: none;
}

.empty-state-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-10);
    margin-top: var(--space-8);
}

.table-state-cell {
    padding: var(--space-20) !important;
}

.table-state-cell .empty-state-card,
.table-state-cell .loading-state-card {
    min-height: 160px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4, 4px);
    height: 22px;
    padding: 0 var(--space-8);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.badge > .ph,
.badge > i {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1;
}

.badge__label {
    min-width: 0;
}

.badge-info {
    color: var(--text-brand);
    background: var(--bg-brand-popup);
    border-color: var(--bg-brand-popup);
}

.badge-success {
    color: var(--status-success);
    background: var(--status-success-soft);
    border-color: var(--status-success-soft);
}

.badge-warning {
    color: var(--status-warning);
    background: var(--status-warning-soft);
    border-color: var(--status-warning-soft);
}

.badge-danger,
.badge-error {
    color: var(--status-danger);
    background: var(--status-danger-soft);
    border-color: var(--status-danger-soft);
}

.badge-neutral {
    color: var(--text-secondary);
    background: var(--bg-overlay-l2);
    border-color: var(--border-subtle);
}

.badge-brand {
    color: var(--text-brand);
    background: color-mix(in srgb, var(--bg-brand) 14%, var(--bg-surface));
    border-color: color-mix(in srgb, var(--bg-brand) 22%, var(--border-subtle));
}

.client-directory-name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-10);
    min-width: 0;
}

.client-directory-name--sub {
    padding-left: var(--space-16);
}

.client-directory-row--sub td:first-child {
    border-left: 3px solid color-mix(in srgb, var(--bg-brand) 35%, var(--border-subtle));
}

.client-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--client-brand-color, var(--bg-overlay-l3));
    border: 1px solid color-mix(in srgb, var(--client-brand-color, var(--border-subtle)) 40%, var(--border-subtle));
    vertical-align: middle;
}

.bulk-selection-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-overlay-l1);
    color: var(--text-primary);
}

.bulk-selection-toolbar[hidden] {
    display: none !important;
}

.bulk-selection-toolbar__count {
    margin-right: auto;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bulk-selection-control,
.bulk-selection-row {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.bulk-selection-row {
    margin-right: 8px;
    vertical-align: middle;
}

.bulk-selection-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--bg-brand);
    cursor: pointer;
}

.data-card__title-block {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

@media (max-width: 899px) {
    .bulk-selection-toolbar {
        align-items: stretch;
    }

    .bulk-selection-toolbar__count {
        flex: 1 0 100%;
        margin-right: 0;
    }

    .bulk-selection-toolbar .ds-btn {
        flex: 1 1 auto;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.page-transition-out {
    overflow: hidden;
}

/* Standalone shell brand (auth, error, and other out-of-shell pages) */
.standalone-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: var(--space-12);
    width: fit-content;
    margin-bottom: clamp(18px, 2vw, 28px);
    padding: 16px 22px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--bg-surface) 16%, transparent);
    backdrop-filter: blur(12px);
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.standalone-brand__mark {
    display: block;
    width: 184px;
    height: auto;
    object-fit: contain;
    filter: var(--brand-logo-filter, none);
}

@media (max-width: 899px) {
    .standalone-brand__mark {
        width: clamp(120px, 40vw, 184px);
    }
}

.auth-page {
    position: relative;
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 48px);
    padding-bottom: calc(clamp(20px, 4vw, 48px) + 96px + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--bg-brand) 18%, transparent), transparent 35%),
        radial-gradient(circle at bottom right, color-mix(in srgb, var(--status-success) 14%, transparent), transparent 30%),
        linear-gradient(160deg, var(--bg-base), color-mix(in srgb, var(--bg-base) 88%, var(--bg-base-default)));
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(120deg, transparent 0 48%, color-mix(in srgb, var(--text-default) 5%, transparent) 48% 52%, transparent 52% 100%);
    opacity: 0.45;
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
    gap: clamp(20px, 2vw, 28px);
    align-items: stretch;
    min-height: 0;
}

.auth-hero,
.auth-panel {
    border-radius: 28px;
    min-height: 0;
    align-self: stretch;
}

.auth-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: clamp(28px, 4vw, 48px);
    color: var(--text-inverse);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--bg-invert) 92%, transparent), color-mix(in srgb, var(--bg-brand) 78%, #1f2937)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 32%);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    width: fit-content;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--text-white) 12%, transparent);
    backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--text-inverse);
}

.auth-hero__brand-mark {
    display: block;
    width: 92px;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.auth-hero__title {
    margin-top: var(--space-24);
    max-width: 12ch;
    color: inherit;
    font-family: var(--font-heading);
    font-size: clamp(38px, 5vw, 64px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    min-height: 0;
}

.auth-hero__title-text {
    display: inline;
    color: inherit;
    font-size: 0.8em;
    will-change: contents;
}

.auth-hero__title-cursor {
    display: inline-block;
    width: 0.18em;
    height: 0.9em;
    margin-left: 0.14em;
    background: currentColor;
    vertical-align: -0.08em;
    animation: auth-cursor-blink 1s steps(1, end) infinite;
}

@keyframes auth-cursor-blink {
    50% {
        opacity: 0;
    }
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(24px, 3vw, 32px);
}

.glass-panel {
    padding: var(--space-24);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-brand) 1.25%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-sm);
}

.dashboard-activity-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.dashboard-roadmap-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    margin-bottom: var(--space-24);
}

.dashboard-roadmap-chart-shell {
    min-width: 0;
    overflow-x: auto;
    padding: var(--space-8) 0;
}

.dashboard-chart--roadmap {
    min-width: 720px;
    height: clamp(260px, 34vw, 420px);
}

.dashboard-roadmap-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.dashboard-roadmap-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.dashboard-roadmap-table th,
.dashboard-roadmap-table td {
    padding: var(--space-10) var(--space-12);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.dashboard-roadmap-table thead th {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-roadmap-table tbody tr:last-child th,
.dashboard-roadmap-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-roadmap-table .is-phase th {
    color: var(--text-main);
    font-weight: 650;
}

.dashboard-roadmap-table .is-subphase th {
    padding-left: var(--space-24);
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-roadmap-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 var(--space-8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-overlay-l2);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.dashboard-roadmap-status--in_progress {
    border-color: color-mix(in srgb, var(--text-brand) 28%, var(--border-subtle));
    background: color-mix(in srgb, var(--bg-brand) 10%, var(--bg-surface));
    color: var(--text-brand);
}

.dashboard-roadmap-status--at_risk {
    border-color: color-mix(in srgb, var(--status-warning) 28%, var(--border-subtle));
    background: var(--status-warning-soft);
    color: var(--status-warning);
}

.dashboard-roadmap-status--blocked {
    border-color: color-mix(in srgb, var(--status-danger) 28%, var(--border-subtle));
    background: var(--status-danger-soft);
    color: var(--status-danger);
}

.dashboard-roadmap-status--completed {
    border-color: color-mix(in srgb, var(--status-success) 28%, var(--border-subtle));
    background: var(--status-success-soft);
    color: var(--status-success);
}

.dashboard-activity-table-shell {
    min-width: 0;
}

.dashboard-activity-empty {
    padding-top: var(--space-4);
}

.dashboard-activity-table-scroll {
    max-height: clamp(320px, 46vh, 560px);
    overflow: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--bg-brand) 2%, transparent);
}

.dashboard-activity-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.dashboard-activity-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: var(--space-14) var(--space-16);
    border-bottom: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--bg-surface) 96%, var(--bg-brand) 4%);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-activity-table tbody td {
    padding: var(--space-14) var(--space-16);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 13px;
    vertical-align: middle;
}

.dashboard-activity-table tbody tr {
    transition: background var(--transition-fast);
    cursor: pointer;
}

.dashboard-activity-table tbody tr:hover {
    background: color-mix(in srgb, var(--bg-brand) 3%, transparent);
}

.dashboard-activity-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-activity-table td strong {
    color: var(--text-main);
    font-weight: 600;
}

.dashboard-activity-job-ref {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-activity-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dashboard-activity-cell-stack span {
    color: var(--text-muted);
    font-size: 12px;
}

.dashboard-activity-client {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    min-width: 0;
}

.dashboard-activity-client .client-brand-mark {
    flex-shrink: 0;
}

.vessel-card-client,
.invoice-detail-client,
.search-result-client {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    min-width: 0;
}

.vessel-card-client .client-brand-mark,
.invoice-detail-client .client-brand-mark,
.search-result-client .client-brand-mark {
    flex-shrink: 0;
}

.search-result-card__identity {
    display: flex;
    align-items: center;
    min-width: 0;
}

.tag.tag--client {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
}

/* ==========================================
   Directory data cards (Vessels / Surveyors / Locations)
========================================== */

.data-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    padding: var(--space-20);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-brand) 1.5%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.data-card:hover {
    border-color: color-mix(in srgb, var(--bg-brand) 18%, var(--border-subtle));
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.data-card__header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-12);
    min-width: 0;
}

.data-card__media {
    flex: 0 0 auto;
}

.data-card__title-block {
    flex: 1 1 auto;
    min-width: 0;
}

.data-card__title {
    margin: 0;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.data-card__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-4);
    margin-left: auto;
    max-width: 100%;
}

.data-card__actions.action-bar-inline {
    margin-top: 0;
    padding-top: 0;
}

.data-card__meta.tag-group,
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-6) var(--space-10);
    border-radius: var(--radius-pill);
    background: var(--bg-neutral-soft);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1;
}

.data-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding-top: var(--space-14);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 13px;
}

.data-card--skeleton {
    pointer-events: none;
    user-select: none;
}

.data-card--skeleton:hover {
    transform: none;
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.data-card-skeleton__title {
    display: block;
    width: min(100%, 11rem);
    height: 18px;
    border-radius: var(--radius-8);
}

.data-card-skeleton__action {
    display: inline-block;
    width: 4.5rem;
    height: 32px;
    border-radius: var(--radius-8);
}

.data-card-skeleton__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.data-card-skeleton__tag {
    display: inline-block;
    width: 5.5rem;
    height: 28px;
    border-radius: var(--radius-pill);
}

.data-card-skeleton__tag--wide {
    width: 7.5rem;
}

.data-card-skeleton__footer-line {
    display: block;
    width: min(100%, 8rem);
    height: 12px;
    border-radius: var(--radius-8);
}

.data-card-skeleton__badge {
    display: inline-block;
    width: 4rem;
    height: 24px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.data-card--skeleton-surveyor {
    min-height: 7.5rem;
}

.data-card--skeleton-avatar:not(.data-card--skeleton-surveyor) {
    min-height: 10.5rem;
}

.data-card--skeleton:not(.data-card--skeleton-avatar) {
    min-height: 9.5rem;
}

@media (prefers-reduced-motion: reduce) {
    .data-card--skeleton .ds-skeleton::after {
        animation: none;
    }
}

/* Legacy alias used by older markup */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding-top: var(--space-14);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 13px;
}

.dashboard-activity-surveyor {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    min-width: 0;
}

.dashboard-activity-surveyor img,
.dashboard-activity-surveyor .ds-avatar--image {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: var(--bg-brand-soft);
    object-fit: cover;
    flex-shrink: 0;
}

.dashboard-activity-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    margin-top: var(--space-14);
    padding-top: var(--space-12);
    border-top: 1px solid var(--border-subtle);
}

.dashboard-activity-footer--count-only {
    justify-content: flex-start;
}

.dashboard-activity-footer__copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-16);
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--space-24);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(var(--stat-grid-columns, 2), minmax(0, 1fr));
    gap: var(--space-16);
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--space-24);
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-16);
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--space-24);
}

.kpi-grid__controls {
    display: none;
    justify-content: flex-end;
    gap: var(--space-8);
}

.kpi-grid__control {
    flex: 0 0 auto;
}

.kpi-grid__viewport {
    min-width: 0;
}

.kpi-grid__track {
    display: grid;
    grid-template-columns: repeat(var(--kpi-grid-columns, 3), minmax(0, 1fr));
    gap: var(--space-16);
    width: 100%;
    min-width: 0;
}

.analytics-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    min-height: 280px;
    padding: var(--space-20);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-brand) 1.5%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-sm);
}

.analytics-grid > .analytics-card {
    grid-column: span 5;
}

.analytics-grid > .analytics-card.analytics-card--half {
    grid-column: span 6;
}

.analytics-grid > .analytics-card.analytics-card--third {
    grid-column: span 4;
}

.analytics-grid > .analytics-card.analytics-card--full {
    grid-column: span 12;
}

.analytics-grid > .analytics-card.analytics-card--wide {
    grid-column: span 7;
}

.analytics-card__head {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.analytics-card__eyebrow {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.analytics-card__title {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.analytics-card__subtitle {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.analytics-card__body {
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow: visible;
}

.analytics-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding-top: var(--space-14);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 12px;
}

.analytics-card__footer strong {
    color: var(--text-main);
}

.analytics-card__footer .btn {
    flex: 0 0 auto;
}

.metric-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
    width: 100%;
}

.metric-stack__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-14);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--bg-brand) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--bg-brand) 8%, transparent);
}

.metric-stack__item strong {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 24px;
    line-height: 1.1;
}

.metric-stack__item span {
    color: var(--text-muted);
    font-size: 12px;
}

.metric-stack__item.is-danger {
    background: color-mix(in srgb, var(--status-danger) 8%, transparent);
    border-color: color-mix(in srgb, var(--status-danger) 12%, transparent);
}

.metric-stack__item.is-warning {
    background: color-mix(in srgb, var(--status-warning) 8%, transparent);
    border-color: color-mix(in srgb, var(--status-warning) 12%, transparent);
}

[data-theme="dark"] .metric-stack__item {
    background: color-mix(in srgb, var(--bg-brand) 10%, transparent);
    border-color: color-mix(in srgb, var(--bg-brand) 16%, transparent);
}

.donut-wrap {
    display: grid;
    grid-template-columns: minmax(170px, 200px) minmax(0, 1fr);
    gap: var(--space-20);
    align-items: center;
    width: 100%;
    position: relative;
    overflow: visible;
}

.dashboard-chart {
    width: 100%;
    min-height: 180px;
}

.dashboard-chart--bar,
.dashboard-chart--line {
    height: 186px;
}

.dashboard-chart--horizontal {
    height: 220px;
}

.dashboard-chart__canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.donut-chart {
    position: relative;
    z-index: 1;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.donut-chart__ring {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bg-brand) 8%, transparent);
}

.donut-chart__ring canvas {
    width: 100% !important;
    height: 100% !important;
}

.donut-chart__center {
    position: absolute;
    inset: 22px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    border-radius: 50%;
    background: var(--bg-surface);
    text-align: center;
}

.donut-chart__center strong {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 28px;
    line-height: 1;
}

.donut-chart__center span {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.3;
}

.donut-chart--empty .donut-chart__ring {
    background: color-mix(in srgb, var(--bg-brand) 4%, transparent);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
}

.donut-legend__item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-10);
    color: var(--text-secondary);
    font-size: 13px;
}

.donut-legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.donut-legend__label {
    min-width: 0;
}

.donut-legend__value {
    color: var(--text-main);
    font-weight: 600;
}

.chart-tooltip {
    position: absolute;
    z-index: 12;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
    max-width: 220px;
    padding: var(--space-8) var(--space-10);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--bg-surface) 96%, transparent);
    box-shadow: var(--shadow-md);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.35;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 8px));
    transition: opacity var(--transition-fast);
    backdrop-filter: blur(10px);
}

.chart-tooltip[hidden] {
    display: none;
}

.chart-tooltip__title {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.chart-tooltip__row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    min-width: 0;
}

.chart-tooltip__swatch {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.chart-tooltip__value {
    min-width: 0;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.auth-panel__header {
    margin-bottom: var(--space-24);
}

.auth-panel__eyebrow {
    display: inline-flex;
    margin-bottom: var(--space-8);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-demo-list {
    display: grid;
    gap: var(--space-12);
}

.auth-demo-form {
    display: block;
}

.auth-demo-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-16);
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.auth-demo-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-brand);
    box-shadow: var(--shadow-sm);
}

.auth-demo-card__avatar {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-surface-secondary);
}

.auth-demo-card__avatar img {
    display: block;
    width: 100%;
    height: 100%;
}

.auth-demo-card__content {
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
    min-width: 0;
}

.auth-demo-card__content small {
    color: var(--text-muted);
}

.auth-panel__footer {
    margin-top: var(--space-24);
    color: var(--text-muted);
    font-size: 12px;
}

.account-profile {
    display: grid;
    gap: var(--space-24);
}

.account-profile__identity {
    display: flex;
    align-items: center;
    gap: var(--space-20);
    padding: var(--space-20);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface-secondary);
}

.account-profile__avatar .ds-avatar--image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.account-profile__summary {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
}

.account-profile__name {
    color: var(--text-main);
    font-size: 18px;
    line-height: 1.2;
}

.account-profile__role {
    display: block;
}

.account-profile__fields {
    margin: 0;
}

.account-offline-status {
    margin-bottom: 1rem;
}

.account-offline-modules {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.account-offline-module h4 {
    margin: 0;
    font-size: 0.95rem;
}

.auth-panel__footer--split {
    display: flex;
    justify-content: flex-start;
}

.auth-flash {
    margin-bottom: var(--space-16);
    padding: var(--space-12) var(--space-16);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.auth-flash--success {
    color: var(--status-success);
    background: color-mix(in srgb, var(--status-success) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--status-success) 24%, transparent);
}

.auth-flash--error {
    color: var(--status-danger);
    background: color-mix(in srgb, var(--status-danger) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--status-danger) 24%, transparent);
}

.auth-form {
    display: grid;
    gap: var(--space-16);
}

.auth-form__submit {
    width: 100%;
    justify-content: center;
}

.auth-link-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-brand);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.auth-link-btn:hover {
    text-decoration: underline;
}

.input-password {
    position: relative;
}

.input-password input {
    width: 100%;
    padding-right: 44px;
}

.input-password__toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.input-password__toggle:hover {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-brand) 8%, transparent);
}

.auth-panel__views {
    display: grid;
}

.auth-panel__view[hidden] {
    display: none !important;
}

.auth-form .input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.auth-form .input-group label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.auth-form .input-group input:not([type="checkbox"]):not([type="radio"]),
.auth-form .input-group select,
.auth-form .input-group textarea {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-brand) 1%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
    color: var(--text-main);
    font: inherit;
    font-size: 16px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-form .input-group input:focus,
.auth-form .input-group select:focus,
.auth-form .input-group textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--border-brand) 40%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg-brand) 12%, transparent);
}

.auth-form .input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
}

.auth-form .input-grid .input-group {
    grid-column: span 2;
}

.auth-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    min-height: 44px;
    padding: 0 var(--space-16);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--bg-brand);
    color: var(--text-onbrand);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.auth-form .btn:hover {
    background: var(--bg-brand-hover);
}

.auth-form .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .auth-form .input-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 899px) {
    .auth-page {
        padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
    }

    .auth-shell {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .auth-hero {
        display: none;
    }

    .auth-page > .release-footer {
        margin-top: var(--space-12);
    }

    .auth-page > .release-footer .release-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-8);
    }

    .auth-page > .release-footer .release-footer__brand,
    .auth-page > .release-footer .release-footer__meta {
        white-space: normal;
    }

    .auth-page > .release-footer .release-footer__meta {
        text-align: left;
    }
}

/* Offline Sync Banner - shared across app shell */
.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: var(--shell-z-banner);
    display: flex;
    align-items: center;
    gap: var(--space-12);
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid color-mix(in srgb, var(--status-warning) 35%, var(--border-subtle));
    background: color-mix(in srgb, var(--status-warning) 12%, var(--surface-raised));
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.impersonation-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--status-warning) 18%, transparent);
    color: var(--status-warning);
    flex-shrink: 0;
}

.impersonation-banner__icon i {
    font-size: 1.125rem;
}

.impersonation-banner__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.impersonation-banner__copy strong {
    font-size: 0.9375rem;
    line-height: 1.35;
}

.impersonation-banner__copy span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.impersonation-banner__action {
    flex-shrink: 0;
    white-space: nowrap;
}

[data-theme="dark"] .impersonation-banner {
    background: color-mix(in srgb, var(--status-warning) 16%, var(--surface-raised));
    border-bottom-color: color-mix(in srgb, var(--status-warning) 28%, var(--border-subtle));
}

@media (max-width: 899px) {
    .impersonation-banner {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .impersonation-banner__action {
        width: 100%;
        justify-content: center;
    }
}

.offline-sync-banner {
    position: fixed;
    right: var(--space-20);
    bottom: var(--space-20);
    z-index: var(--shell-z-banner);
    display: flex;
    align-items: center;
    gap: var(--space-12);
    width: min(420px, calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.offline-sync-banner[hidden] {
    display: none !important;
}

.offline-sync-banner[data-tone="offline"] {
    border-left: 4px solid var(--status-warning);
}

.offline-sync-banner[data-tone="syncing"] {
    border-left: 4px solid var(--text-brand);
}

.offline-sync-banner[data-tone="success"] {
    border-left: 4px solid var(--status-success);
}

.offline-sync-banner[data-tone="danger"] {
    border-left: 4px solid var(--status-danger);
}

.offline-sync-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-brand);
    flex: 0 0 auto;
}

.offline-sync-banner.is-syncing .offline-sync-banner__icon i {
    animation: offlineSyncSpin 0.9s linear infinite;
}

.offline-sync-banner__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.offline-sync-banner__copy strong {
    font-size: 0.95rem;
    line-height: 1.3;
}

.offline-sync-banner__copy span {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.offline-sync-banner__action {
    flex: 0 0 auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-elevated);
    color: var(--text-main);
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
}

.offline-sync-banner__action:hover {
    border-color: var(--text-brand);
    color: var(--text-brand);
}

@keyframes offlineSyncSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* App shell layout */
.app-layout {
    display: flex;
    flex: 1 0 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    --notification-drawer-width: 420px;
}

.app-layout.is-notification-drawer-open {
    height: 100vh;
    overflow: hidden;
}

.app-layout.is-notification-drawer-open .main-wrapper {
    min-height: 0;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
}

.collapse-sidebar-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: transparent; color: var(--text-muted); cursor: pointer; }
.collapse-sidebar-btn:hover { background: var(--bg-neutral-soft); color: var(--text-main); }
@media (max-width: 899px) { .collapse-sidebar-btn { display: none; } }
@media (min-width: 900px) {
    :root.sidebar-collapsed { --sidebar-width: 76px; }
    :root.sidebar-collapsed .sidebar-header { justify-content: center; padding-inline: 12px; }
    :root.sidebar-collapsed .brand-link { justify-content: center; }
    :root.sidebar-collapsed .brand-icon { width: 42px; }
    :root.sidebar-collapsed .brand-copy, :root.sidebar-collapsed .sidebar-section__label, :root.sidebar-collapsed .sidebar-section__chevron, :root.sidebar-collapsed .nav-item span, :root.sidebar-collapsed .sidebar-footer .nav-item span { display: none; }
    :root.sidebar-collapsed .sidebar-section__toggle, :root.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 8px; }
    :root.sidebar-collapsed .sidebar-section__inner { padding-left: 0; }
    :root.sidebar-collapsed .nav-item { min-height: 44px; }
    :root.sidebar-collapsed .nav-item i { font-size: 20px; }
    :root.sidebar-collapsed .collapse-sidebar-btn i { transform: rotate(180deg); }
}

.sidebar.open {
    transform: translateX(0);
}

@media (min-width: 900px) {
    .sidebar {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }

    .sidebar-overlay {
        display: none;
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-20) var(--space-16) var(--space-16);
    border-bottom: 1px solid var(--border-subtle);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-10);
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand-icon {
    display: block;
    width: 132px;
    height: auto;
    object-fit: contain;
    filter: var(--brand-logo-filter, none);
}

.brand-icon-small {
    display: block;
    width: 96px;
    height: auto;
    object-fit: contain;
    filter: var(--brand-logo-filter, none);
}

[data-theme="dark"] .brand-icon,
[data-theme="dark"] .brand-icon-small,
[data-theme="dark"] .standalone-brand__mark {
    filter: brightness(0) invert(1);
}

.brand-copy {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.menu-btn,
.close-sidebar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.menu-btn:hover,
.close-sidebar-btn:hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
}

.menu-btn i,
.close-sidebar-btn i {
    font-size: 20px;
}

@media (min-width: 900px) {
    .mobile-header-left,
    .menu-btn,
    .close-sidebar-btn,
    .mobile-brand {
        display: none;
    }
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-12);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.sidebar-section__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
    width: 100%;
    min-height: 32px;
    padding: 0 var(--space-8);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.sidebar-section__toggle:hover {
    color: var(--text-main);
    background: var(--bg-neutral-soft);
}

.sidebar-section__label {
    flex: 1 1 auto;
    text-align: left;
}

.sidebar-section__chevron {
    font-size: 14px;
    transition: transform var(--transition-fast);
}

.sidebar-section.is-collapsed .sidebar-section__chevron {
    transform: rotate(-90deg);
}

.sidebar-section.is-collapsed .sidebar-section__content {
    display: none;
}

.sidebar-section__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-left: var(--space-4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    width: 100%;
    min-height: 40px;
    padding: 0 var(--space-12);
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-item i {
    flex: 0 0 auto;
    font-size: 18px;
}

.nav-item:hover {
    background: var(--bg-neutral-soft);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    font-weight: 600;
}

.nav-item.text-danger {
    color: var(--status-danger);
}

.nav-item.text-danger:hover {
    background: var(--status-danger-soft);
    color: var(--status-danger);
}

.sidebar-footer {
    padding: var(--space-12) var(--space-12) var(--space-16);
    border-top: 1px solid var(--border-subtle);
}

.sidebar-logout-form {
    margin: 0;
}

.main-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.release-footer {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: var(--space-16) 0;
    box-sizing: border-box;
}

.auth-page > .release-footer {
    width: min(1240px, 100%);
    justify-self: center;
    margin: var(--space-16) 0 0;
}

.release-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: var(--space-10) var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.release-footer__copyright {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35em;
    margin: 0;
    min-width: 0;
    max-width: 100%;
    color: var(--text-secondary);
    line-height: 1.45;
}

.release-footer__brand {
    font-weight: 600;
    min-width: 0;
}

.release-footer__link {
    color: var(--text-brand);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.release-footer__link:hover {
    color: var(--text-brand-strong, var(--text-brand));
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.release-footer__meta {
    flex: 0 1 auto;
    text-align: right;
    white-space: nowrap;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-12);
    padding: var(--space-12) var(--space-16);
    border-bottom: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    backdrop-filter: blur(12px);
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    flex: 0 0 auto;
}

.header-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 560px;
}

.header-search__form {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search__form i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

.header-search__form input {
    width: 100%;
    min-height: 40px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.header-search__form input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--border-brand) 40%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg-brand) 12%, transparent);
}

.header-search__form--has-keybind input {
    padding-right: 52px;
}

.header-search__keybind-hint {
    position: absolute;
    right: 12px;
    display: inline-flex;
    align-items: center;
    pointer-events: none;
}

.header-search__mobile-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    margin-left: auto;
    flex: 0 0 auto;
}

.topbar-action,
.page-tabs__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.topbar-action--text {
    padding-inline: 12px;
}

.topbar-action--menu {
    min-width: 0;
    padding-inline: 12px;
}

.topbar-action--icon-only {
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.topbar-action:hover,
.page-tabs__tab:hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
}

.topbar-action i,
.page-tabs__tab i {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    color: var(--text-secondary);
}

.topbar-action:focus-visible,
.page-tabs__tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg-brand) 14%, transparent);
}

.page-tabs__track .page-tabs__tab {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
}

.topbar-action--theme {
    justify-content: center;
}

.topbar-action--theme i {
    color: var(--text-secondary);
}

.topbar-action__label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    line-height: 1.2;
    text-align: left;
}

.topbar-action--menu .topbar-action__label {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    line-height: 1.1;
}

.content-container {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1440px;
    min-width: 0;
    margin: 0 auto;
    padding: var(--space-20) var(--space-16) calc(var(--space-20) + 96px + env(safe-area-inset-bottom, 0px));
    position: relative;
}

.app-layout.is-notification-drawer-open .content-container {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

.content-container--full-width {
    max-width: none;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-20);
    margin-bottom: var(--space-24);
}

.page-header__content {
    flex: 1 1 auto;
    min-width: 0;
}

.page-header__eyebrow {
    display: inline-flex;
    margin-bottom: var(--space-8);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.page-header h1 {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.page-header p {
    margin-top: var(--space-8);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    max-width: 60ch;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-12);
    margin-left: auto;
}

.page-header__controls,
.page-header__actions-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-10);
}

.page-header__actions .btn,
.page-filters-bar__toggle,
.page-filters-bar__input input,
.page-filters-panel .form-field__control,
.page-filters-field > select,
.filter-select {
    min-height: var(--toolbar-control-height);
}

/* Header danger actions: solid fill + white label (match brand primary weight). */
.page-header__actions .btn-danger-subtle,
.page-header__actions .ds-btn--danger-subtle {
    background: var(--status-error-default);
    color: var(--text-onaccent);
    border-color: var(--status-error-default);
}

.page-header__actions .btn-danger-subtle:hover,
.page-header__actions .ds-btn--danger-subtle:hover {
    background: var(--status-error-hover);
    color: var(--text-onaccent);
    border-color: var(--status-error-hover);
}

.page-header__actions .btn-danger-subtle:active,
.page-header__actions .ds-btn--danger-subtle:active {
    background: var(--status-error-active);
    color: var(--text-onaccent);
    border-color: var(--status-error-active);
}

.page-header__actions .btn-danger-subtle .ds-keybind--button,
.page-header__actions .ds-btn--danger-subtle .ds-keybind--button {
    color: var(--text-onbrand);
    background: color-mix(in srgb, var(--text-white) 16%, transparent);
    border-color: color-mix(in srgb, var(--text-white) 28%, transparent);
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--text-white) 10%, transparent);
}

.page-header__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: var(--space-8);
    padding: 0 var(--space-6);
    border-radius: var(--radius-full);
    background: var(--bg-overlay-l2);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.page-header__count--inverse {
    background: color-mix(in srgb, var(--text-inverse) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-inverse) 22%, transparent);
    color: var(--text-inverse);
}

.action-bar-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
    margin-top: var(--space-20);
    padding-top: var(--space-4);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--shell-z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
    background: color-mix(in srgb, var(--bg-overlay) 88%, var(--bg-surface) 12%);
    backdrop-filter: blur(10px);
}

.modal-overlay.active {
    display: flex;
}

.image-lightbox {
    padding: var(--space-16);
}

.image-lightbox__dialog {
    display: flex;
    flex-direction: column;
    width: min(1200px, 100%);
    max-height: 94vh;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xl);
}

.image-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: var(--space-12);
    padding: var(--space-12) var(--space-16);
    border-bottom: 1px solid var(--border-subtle);
}

.image-lightbox__header h2 {
    margin: 0;
    font-size: var(--text-lg);
}

.image-lightbox__body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: auto;
    padding: var(--space-16);
    background: color-mix(in srgb, var(--bg-base-secondary) 82%, var(--bg-surface));
}

.image-lightbox__body img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(94vh - 100px);
    object-fit: contain;
    border-radius: var(--radius-md);
}

[data-theme="dark"] .image-lightbox__body {
    background: color-mix(in srgb, #000 32%, var(--bg-surface));
}

.modal-overlay.active.is-stacked-modal {
    z-index: calc(var(--shell-z-modal) + 2);
}

/* Confirmation dialogs can open above any parent modal, including the report
   workflow dialog and mobile editor sheets. Keep the decision surface topmost. */
#modalConfirm.active {
    z-index: calc(var(--shell-z-modal) + 10);
}

html.is-modal-open {
    overflow: hidden;
}

.modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(92vh, 900px);
    overflow: hidden;
}

.modal-content--wide {
    max-width: min(720px, 100%);
}

@media (min-width: 900px) {
    #modalJob .modal-content--wide,
    #modalNominationReview .modal-content--wide {
        max-width: min(900px, calc(100vw - 48px));
    }
}

.modal-content--compact {
    max-width: min(520px, 100%);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    flex: 0 0 auto;
    padding: var(--space-16) var(--space-20);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.3;
}

.modal-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-16) var(--space-20);
}

/* Job modal: hide ISPS / Total Hours on New Job Entry only (edit keeps them). */
[data-job-modal-mode="create"] [data-job-create-hidden] {
    display: none !important;
}

.job-entry-step-chrome {
    flex: 0 0 auto;
    padding: var(--space-8) var(--space-20) 0;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.job-entry-step-chrome__progress {
    display: flex;
    gap: 6px;
}

.job-entry-step-chrome__seg {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--border-subtle);
}

.job-entry-step-chrome__seg.is-current,
.job-entry-step-chrome__seg.is-done {
    background: var(--brand, #2563eb);
}

.job-entry-step-chrome__seg.is-done {
    opacity: 0.55;
}

.job-entry-step-chrome__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-8);
    padding: var(--space-8) 0 var(--space-10);
}

.job-entry-step-chrome__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.job-entry-step-chrome__count {
    font-size: 12px;
    color: var(--text-secondary);
}

#modalJob.is-job-entry-stepped .modal-body--job > [data-job-entry-step][hidden] {
    display: none !important;
}

/* Stepped create: one field per row so long labels + (Required) never misalign halves. */
#modalJob.is-job-entry-stepped .modal-body--job .input-grid {
    grid-template-columns: 1fr;
}

#modalJob.is-job-entry-stepped .modal-body--job .input-grid > .input-group,
#modalJob.is-job-entry-stepped .modal-body--job .input-grid > .input-group.half,
#modalJob.is-job-entry-stepped .modal-body--job .input-grid > .input-group.full {
    grid-column: 1 / -1;
}

#modalJob.is-job-entry-stepped .modal-body--job .form-field__label,
#modalJob.is-job-entry-stepped .modal-body--job .input-group > label:not(.switch) {
    flex-wrap: nowrap;
    max-width: 100%;
}

.bunker-stems-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
}

.bunker-stems-editor,
.input-group:has(.bunker-stems-editor),
[data-job-operational-panel="bunker"] {
    min-width: 0;
    max-width: 100%;
}

.bunker-stems-editor__table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    container: bunker-stems / inline-size;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 10px);
    background: var(--bg-surface);
}

.bunker-stems-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.bunker-stems-table th:nth-child(1),
.bunker-stems-table td:nth-child(1) {
    width: 19%;
}

.bunker-stems-table th:nth-child(2),
.bunker-stems-table td:nth-child(2) {
    width: 27%;
}

.bunker-stems-table th:nth-child(3),
.bunker-stems-table td:nth-child(3) {
    width: 20%;
}

.bunker-stems-table th:nth-child(4),
.bunker-stems-table td:nth-child(4) {
    width: 16%;
}

.bunker-stems-table th:nth-child(5),
.bunker-stems-table td:nth-child(5) {
    width: 13%;
}

.bunker-stems-table th:nth-child(6),
.bunker-stems-table td:nth-child(6) {
    width: 5%;
}

#modalJob.is-job-entry-stepped .modal-body--job,
#modalJob.is-job-entry-stepped .modal-body--job .form-section,
#modalJob.is-job-entry-stepped .modal-body--job .input-grid {
    min-width: 0;
}

.bunker-stems-table th,
.bunker-stems-table td {
    padding: var(--space-8);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    text-align: left;
}

.bunker-stems-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--bg-muted, #f1f5f9) 80%, transparent);
}

.bunker-stems-table th.bunker-stems-table__quantity-header {
    min-width: 0;
    color: var(--text-on-brand);
    background: var(--brand-primary);
}

.bunker-stems-table__quantity-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
    min-width: 0;
}

.bunker-stems-table__quantity-heading > span:first-child {
    flex: 0 0 auto;
}

.bunker-stems-table tr:last-child td {
    border-bottom: 0;
}

.bunker-stems-table select,
.bunker-stems-table input[type="number"],
.bunker-stems-table .time-input-wrap,
.bunker-stems-table input[data-time-picker] {
    width: 100%;
    min-width: 0;
}

.bunker-stem-quantity {
    display: grid;
    gap: var(--space-6);
    min-width: 0;
}

.bunker-stem-quantity__modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding: 2px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-muted);
}

.bunker-stems-table__quantity-header .bunker-stem-quantity__modes {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1px;
    border-color: color-mix(in srgb, var(--text-on-brand) 35%, transparent);
    background: color-mix(in srgb, var(--text-on-brand) 14%, transparent);
}

.bunker-stem-quantity__mode {
    min-height: 32px;
    padding: 0 var(--space-8);
    border: 0;
    border-radius: var(--radius-sm, 5px);
    color: var(--text-secondary);
    background: transparent;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.bunker-stem-quantity__mode.is-active {
    color: var(--text-on-brand);
    background: var(--brand-primary);
}

.bunker-stems-table__quantity-header .bunker-stem-quantity__mode {
    min-height: 24px;
    padding: 0 var(--space-6);
    color: color-mix(in srgb, var(--text-on-brand) 82%, transparent);
    font-size: 0.7rem;
}

.bunker-stems-table__quantity-header .bunker-stem-quantity__mode.is-active {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.bunker-stem-quantity__mode:focus-visible {
    outline: 2px solid var(--focus-ring, var(--brand-primary));
    outline-offset: 2px;
}

.bunker-stem-quantity__range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.bunker-stem-quantity__field {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
}

.bunker-stem-quantity__input {
    display: flex;
    align-items: center;
    min-width: 0;
}

.bunker-stem-quantity__input input {
    min-width: 0;
    flex: 1 1 auto;
}

.bunker-stem-quantity__range .bunker-stem-quantity__input {
    position: relative;
    min-width: 0;
}

.bunker-stem-quantity__range .bunker-stem-quantity__input input {
    min-width: 0;
    padding-right: 1.75rem;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.bunker-stem-quantity__range .bunker-stem-quantity__input > span {
    position: absolute;
    right: var(--space-8);
    margin-left: 0;
    padding-right: 0;
}

.bunker-stem-quantity__input > span {
    margin-left: calc(var(--space-8) * -1);
    padding-right: var(--space-8);
    color: var(--text-secondary);
    pointer-events: none;
}

.bunker-stem-quantity [hidden] {
    display: none !important;
}

.bunker-stems-table .time-input-wrap {
    min-width: 0;
}

@media (max-width: 1199px) {
    .bunker-stems-table,
    .bunker-stems-table tbody {
        display: block;
    }

    .bunker-stems-table thead {
        display: none;
    }

    .bunker-stems-table tbody {
        padding: var(--space-10);
    }

    .bunker-stems-table tbody tr {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--space-10);
        padding: var(--space-10) 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .bunker-stems-table tbody tr:first-child {
        padding-top: 0;
    }

    .bunker-stems-table tbody tr:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .bunker-stems-table tbody td {
        display: grid;
        align-content: start;
        gap: var(--space-4);
        width: auto !important;
        padding: 0;
        border-bottom: 0;
    }

    .bunker-stems-table tbody td::before {
        content: attr(data-bunker-stem-label);
        color: var(--text-secondary);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .bunker-stems-table tbody td:nth-child(2) {
        grid-column: span 3;
    }

    .bunker-stems-table tbody td:last-child {
        grid-column: auto;
        align-content: end;
        justify-items: end;
        align-self: end;
    }
}

@media (max-width: 599px) {
    .bunker-stems-table tbody tr {
        grid-template-columns: minmax(0, 1fr);
    }

    .bunker-stems-table tbody td:nth-child(2) {
        grid-column: auto;
    }

    .bunker-stems-table tbody td:last-child {
        grid-column: auto;
    }
}

/* Modal width can be narrow even when the browser viewport is wide. */
@container bunker-stems (max-width: 960px) {
    .bunker-stems-table,
    .bunker-stems-table tbody {
        display: block;
    }

    .bunker-stems-table thead {
        display: none;
    }

    .bunker-stems-table tbody {
        padding: var(--space-10);
    }

    .bunker-stems-table tbody tr {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--space-10);
        padding: var(--space-10) 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .bunker-stems-table tbody tr:first-child {
        padding-top: 0;
    }

    .bunker-stems-table tbody tr:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .bunker-stems-table tbody td {
        display: grid;
        align-content: start;
        gap: var(--space-4);
        width: auto !important;
        padding: 0;
        border-bottom: 0;
    }

    .bunker-stems-table tbody td::before {
        content: attr(data-bunker-stem-label);
        color: var(--text-secondary);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .bunker-stems-table tbody td:nth-child(2) {
        grid-column: span 3;
    }

    .bunker-stems-table tbody td:last-child {
        grid-column: auto;
        align-content: end;
        justify-items: end;
        align-self: end;
    }
}

@container bunker-stems (max-width: 560px) {
    .bunker-stems-table tbody tr {
        grid-template-columns: minmax(0, 1fr);
    }

    .bunker-stems-table tbody td:nth-child(2) {
        grid-column: auto;
    }

    .bunker-stems-table tbody td:last-child {
        grid-column: auto;
    }
}

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

[data-theme="dark"] .bunker-stems-table th {
    background: color-mix(in srgb, var(--bg-muted, #1e293b) 70%, transparent);
}

.modal-footer.action-bar-inline {
    flex: 0 0 auto;
    margin-top: 0;
    padding: var(--space-12) var(--space-20);
    padding-bottom: calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    justify-content: flex-end;
    gap: var(--space-8);
}

.modal-footer.action-bar-inline .btn {
    display: inline-flex;
    align-items: center;
}

/* class display must not override HTML hidden (job entry step chrome). */
.modal-footer.action-bar-inline .btn[hidden] {
    display: none !important;
}

.debit-export-form__helper {
    margin: 0 0 var(--space-16);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.debit-export-form__presets,
.debit-export-form__formats {
    display: grid;
    gap: var(--space-10);
    margin: 0 0 var(--space-16);
    padding: 0;
    border: 0;
    min-width: 0;
}

.debit-export-form__legend {
    display: block;
    float: none;
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
}

.debit-export-form__preset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.debit-export-form__preset-actions .btn.is-active {
    color: var(--text-on-brand);
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.debit-export-form__format-list {
    display: grid;
    gap: var(--space-8);
    min-width: 0;
}

.debit-export-form__format-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: var(--space-12);
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: var(--space-12) var(--space-14);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    box-sizing: border-box;
}

.debit-export-form__format-option:hover {
    border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-subtle));
}

.debit-export-form__format-option:has(input:checked) {
    border-color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 8%, var(--bg-surface));
}

.debit-export-form__format-option input[type="radio"] {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    min-height: 1rem;
    max-width: 1rem;
    margin: 0.2rem 0 0;
    padding: 0;
    flex: none;
    border: none;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    accent-color: var(--brand-primary);
    appearance: auto;
    -webkit-appearance: radio;
    cursor: pointer;
}

.debit-export-form__format-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.debit-export-form__format-copy strong {
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.3;
}

.debit-export-form__format-copy small {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.4;
}

#modalDebitExport .input-grid {
    margin-bottom: var(--space-16);
}

.feedback-debug-panel {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--status-warning-default);
    border-radius: 0.75rem;
    background: var(--status-warning-surface-l1);
}

.feedback-debug-panel__heading {
    color: var(--status-warning-default);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.feedback-debug-panel__note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.feedback-debug-panel__output {
    max-height: 26rem;
    margin: 0;
    padding: 0.75rem;
    overflow: auto;
    border-radius: 0.55rem;
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

[data-theme="dark"] .feedback-debug-panel {
    background: color-mix(in srgb, var(--status-warning-surface-l1) 88%, transparent);
}

.keyboard-shortcuts__group + .keyboard-shortcuts__group {
    margin-top: var(--space-20);
}

.keyboard-shortcuts__category {
    margin: 0 0 var(--space-8);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.keyboard-shortcuts__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-8);
}

.keyboard-shortcuts__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-10) var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.keyboard-shortcuts__label {
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.4;
}

.modal-tabs {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.modal-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-8);
}

.modal-tabs__tab {
    display: inline-flex;
    align-items: center;
    padding: var(--space-8) var(--space-4);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.modal-tabs__tab:hover {
    color: var(--text-main);
}

.modal-tabs__tab.is-active {
    color: var(--text-main);
}

.modal-tabs__tab.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(-1 * var(--space-8) - 1px);
    height: 2px;
    background: var(--text-main);
}

.modal-tab-panel[hidden] {
    display: none !important;
}

.modal-body > .action-bar-inline:last-child {
    flex: 0 0 auto;
    margin-top: var(--space-16);
    padding-top: var(--space-12);
    padding-bottom: calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    justify-content: flex-end;
}

.btn-utility {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    height: 28px;
    padding: 0 var(--spacer-12);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}
.btn-utility:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
    border-color: var(--border-default);
}
.btn-utility:active {
    background: var(--bg-neutral-soft);
}
.btn-utility[disabled] {
    color: var(--text-disabled);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-utility.text-danger {
    color: var(--status-danger);
}

.btn-utility--danger {
    color: var(--status-danger);
}

.btn-utility.text-danger:hover,
.btn-utility--danger:hover {
    background: color-mix(in srgb, var(--status-danger) 8%, transparent);
    border-color: color-mix(in srgb, var(--status-danger) 24%, transparent);
    color: var(--status-danger);
}

.mysql-seed-progress {
    display: grid;
    gap: var(--space-16);
}

.mysql-seed-progress__header {
    display: grid;
    gap: var(--space-4);
}

.mysql-seed-progress__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-12);
    color: var(--text-muted);
    font-size: var(--font-size-12);
}

.mysql-seed-progress__steps {
    display: grid;
    gap: var(--space-8);
    padding: 0;
    margin: 0;
    list-style: none;
}

.mysql-seed-progress__steps li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-12) var(--space-16);
    border-radius: var(--radius-12);
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-default);
}

.mysql-seed-progress__steps li::after {
    content: '';
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--border-default);
    flex: 0 0 auto;
}

.mysql-seed-progress__steps li.is-active {
    border-color: var(--bg-brand);
    background: var(--bg-brand-surface);
}

.mysql-seed-progress__steps li.is-active::after {
    background: var(--bg-brand);
}

.mysql-seed-progress__steps li.is-complete {
    border-color: var(--status-success-default);
    background: var(--status-success-surface-l1);
}

.mysql-seed-progress__steps li.is-complete::after {
    background: var(--status-success-default);
}

.mysql-seed-progress__steps li.is-error {
    border-color: var(--status-danger-default);
    background: var(--status-danger-surface-l1);
}

.mysql-seed-progress__steps li.is-error::after {
    background: var(--status-danger-default);
}

.notification-detail {
    display: grid;
    gap: var(--space-16);
}

.notification-detail__intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-8);
}

.notification-detail__intro-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-8);
}

.notification-detail__summary {
    margin: 0;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

.notification-detail__message {
    padding: var(--space-12) var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-neutral-soft);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.notification-detail__meta {
    display: grid;
    gap: var(--space-10);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.notification-detail__row {
    display: grid;
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
    gap: var(--space-12);
    align-items: start;
}

.notification-detail__label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notification-detail__value {
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 720px) {
    .notification-detail__row {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

.page-tab-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.view-section > .page-tabs,
.view-section > .page-header,
.view-section > .page-filters-shell {
    width: 100%;
    max-width: 100%;
}

.page-tab-panel > :is(#invoiceInsightsKpi, #financeDashboardMetrics) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: var(--space-16);
}

.page-tab-panel > :is(.analytics-grid, .stat-grid, .kpi-grid, .glass-panel, .info-block, .page-filters-shell, .page-results-shell, .data-grid, .settings-stack, .system-role-workspace) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.page-tab-panel > .analytics-grid:last-child,
.page-tab-panel > .stat-grid:last-child,
.page-tab-panel > .kpi-grid:last-child,
.page-tab-panel > .glass-panel:last-child {
    margin-bottom: 0;
}

.search-bar--page-filters {
    margin-bottom: 0;
}

.page-filters-shell[hidden] {
    display: none !important;
}

.page-filters-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    margin-bottom: 0;
}

.page-filters-shell:has(> .page-filters-bar),
.page-filters-shell:has(> .page-filters-panel:not([hidden])) {
    margin-bottom: var(--space-20);
}

.page-filters-bar {
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

.page-filters-bar--filters-only {
    justify-content: flex-end;
}

.page-filters-bar__input {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.page-filters-bar__toggle {
    flex: 0 0 auto;
    white-space: nowrap;
}

.page-filters-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    column-gap: var(--space-12);
    row-gap: var(--space-8);
}

/* Open Filters panel: shared card surface (desktop). Mobile uses the bottom-sheet rules below. */
.page-filters-panel:not([hidden]) {
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-brand) 1.25%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-sm);
}

.page-filters-panel__query,
.page-filters-panel .search-bar,
.page-filters-panel .search-bar--page-filters {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.page-filters-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    min-width: 0;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.page-filters-field span {
    color: var(--text-muted);
}

/* Wrapper owns chrome once searchable-select (or form-field) wraps the control. */
.page-filters-panel .form-field__control {
    width: 100%;
    min-height: var(--toolbar-control-height);
}

.page-filters-field .form-field__control > select {
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 0 var(--space-24) 0 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    outline: none;
    appearance: none;
}

.page-filters-field .form-field__control > select:focus {
    border: none;
    box-shadow: none;
    outline: none;
    background: transparent;
}

/* Bare select before enhancement: single chrome only (no outer shell yet). */
.page-filters-field > select {
    width: 100%;
    min-height: var(--toolbar-control-height);
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
}

.page-filters-field > select:focus {
    outline: none;
    border-color: var(--border-contrast);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg-brand) 12%, transparent);
}

.page-filters-panel__actions {
    display: flex;
    align-items: center;
    align-self: center;
    min-width: 0;
}

.page-filters-panel__actions:not(:has([data-page-filters-clear="filters"]:not([hidden]))) {
    display: none;
}

.page-filters-panel__actions .page-filters-clear--filters {
    min-height: var(--toolbar-control-height);
    white-space: nowrap;
}

.page-results-shell {
    position: relative;
    min-height: 240px;
}

.page-filters-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: var(--space-20);
    background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.page-filters-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.page-filters-overlay .loading-state-card {
    margin: 0;
    min-width: min(360px, 100%);
}

.page-filters-panel[hidden] {
    display: none !important;
}

.page-filters-panel__sheet-head,
.page-filters-panel__sheet-foot {
    display: none;
}

.page-filters-panel__sheet-body {
    display: contents;
}

@media (max-width: 900px) {
    .page-filters-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-filters-shell.is-filter-sheet-open::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: var(--bg-overlay);
    }

    .page-filters-panel:not([hidden]) {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1045;
        display: flex;
        flex-direction: column;
        gap: 0;
        max-height: min(85vh, 720px);
        margin: 0;
        padding: 0;
        border: 1px solid var(--border-subtle);
        border-bottom: 0;
        border-radius: 20px 20px 0 0;
        background: var(--bg-surface);
        box-shadow: var(--shadow-xl);
        overflow: hidden;
    }

    .page-filters-panel__sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-12);
        padding: var(--space-14) var(--space-16);
        border-bottom: 1px solid var(--border-subtle);
        flex: 0 0 auto;
    }

    .page-filters-panel__sheet-head strong {
        color: var(--text-main);
        font-size: 15px;
        font-weight: 700;
    }

    .page-filters-panel__sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        background: var(--bg-surface);
        color: var(--text-secondary);
        cursor: pointer;
    }

    .page-filters-panel__sheet-body {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-12);
        min-height: 0;
        padding: var(--space-14) var(--space-16);
        overflow: auto;
    }

    .page-filters-panel__query input[type="search"] {
        padding-right: 8.25rem;
        font-size: 16px;
    }

    .page-filters-clear {
        min-height: 36px;
    }

    .page-filters-panel.has-active-filters .page-filters-panel__actions {
        display: flex;
        justify-content: stretch;
    }

    .page-filters-panel__actions .page-filters-clear--filters {
        width: 100%;
        min-height: 44px;
    }

    .page-filters-panel__sheet-foot {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: var(--space-10);
        padding: var(--space-12) var(--space-16) calc(var(--space-14) + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--border-subtle);
        background: color-mix(in srgb, var(--bg-surface) 96%, var(--bg-brand) 4%);
        flex: 0 0 auto;
    }

    .page-filters-panel__sheet-foot .btn {
        min-height: 44px;
    }

    .page-filters-panel .form-field__control,
    .page-filters-field > select {
        min-height: 44px;
    }

    .page-filters-field .form-field__control > select,
    .page-filters-field > select {
        font-size: 16px;
    }

    body.is-filter-sheet-open {
        overflow: hidden;
    }
}

.page-tab-panel[hidden],
[data-tab-panel][hidden] {
    display: none !important;
}

.stat-card--loading {
    grid-column: 1 / -1;
}

.stat-card {
    min-height: 132px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-16);
    padding: var(--space-20);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-brand) 1.75%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-sm);
}

.stat-card--compact {
    min-height: 118px;
    align-items: center;
    gap: var(--space-12);
    padding: var(--space-16);
    border-radius: 20px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 20px;
}

.stat-card--compact .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    font-size: 15px;
}

.bg-blue,
.bg-blue-translucent {
    background: var(--status-info-soft);
    color: var(--status-info);
}

.bg-green {
    background: var(--status-success-soft);
    color: var(--status-success);
}

.bg-cyan,
.bg-cyan-translucent {
    background: var(--bg-brand-soft);
    color: var(--text-brand);
}

.bg-warning-translucent {
    background: var(--status-warning-soft);
    color: var(--status-warning);
}

.bg-success-translucent {
    background: var(--status-success-soft);
    color: var(--status-success);
}

.bg-danger-translucent {
    background: var(--status-danger-soft);
    color: var(--status-danger);
}

.bg-neutral-translucent {
    background: color-mix(in srgb, var(--text-muted) 10%, transparent);
    color: var(--text-muted);
}

/* Job status badges & swatches (global) */
.badge-job-scheduled,
.ds-tag--job-scheduled {
    color: var(--job-status-scheduled);
    background: var(--job-status-scheduled-soft);
    border-color: var(--job-status-scheduled-soft);
}

.badge-job-in-progress,
.ds-tag--job-in-progress {
    color: var(--job-status-in-progress);
    background: var(--job-status-in-progress-soft);
    border-color: var(--job-status-in-progress-soft);
}

.badge-job-completed,
.ds-tag--job-completed {
    color: var(--job-status-completed);
    background: var(--job-status-completed-soft);
    border-color: var(--job-status-completed-soft);
}

.badge-job-report-received,
.ds-tag--job-report-received {
    color: var(--job-status-report-received);
    background: var(--job-status-report-received-soft);
    border-color: var(--job-status-report-received-soft);
}

.badge-job-report-uploaded,
.ds-tag--job-report-uploaded {
    color: var(--job-status-report-uploaded);
    background: var(--job-status-report-uploaded-soft);
    border-color: var(--job-status-report-uploaded-soft);
}

.badge-job-report-checked,
.ds-tag--job-report-checked {
    color: var(--job-status-report-checked);
    background: var(--job-status-report-checked-soft);
    border-color: var(--job-status-report-checked-soft);
}

.badge-job-approved,
.ds-tag--job-approved {
    color: var(--job-status-approved);
    background: var(--job-status-approved-soft);
    border-color: var(--job-status-approved-soft);
}

.badge-job-closed,
.ds-tag--job-closed {
    color: var(--job-status-closed);
    background: var(--job-status-closed-soft);
    border-color: var(--job-status-closed-soft);
}

.badge-job-issue,
.ds-tag--job-issue {
    color: var(--job-status-issue);
    background: var(--job-status-issue-soft);
    border-color: var(--job-status-issue-soft);
}

.badge-job-invoiced,
.ds-tag--job-invoiced {
    color: var(--job-status-invoiced);
    background: var(--job-status-invoiced-soft);
    border-color: var(--job-status-invoiced-soft);
}

.badge-nomination-new,
.badge-nomination-processing {
    color: var(--status-info);
    background: var(--status-info-surface, color-mix(in srgb, var(--status-info) 14%, transparent));
    border-color: color-mix(in srgb, var(--status-info) 24%, transparent);
}

.badge-nomination-ready {
    color: var(--status-primary-default, var(--status-info));
    background: var(--status-primary-surface-l1, color-mix(in srgb, var(--status-primary-default, var(--status-info)) 14%, transparent));
    border-color: color-mix(in srgb, var(--status-primary-default, var(--status-info)) 24%, transparent);
}

.badge-nomination-needs-review {
    color: var(--status-warning);
    background: var(--status-warning-surface, color-mix(in srgb, var(--status-warning) 14%, transparent));
    border-color: color-mix(in srgb, var(--status-warning) 24%, transparent);
}

.badge-nomination-promoted {
    color: var(--status-success);
    background: var(--status-success-surface, color-mix(in srgb, var(--status-success) 14%, transparent));
    border-color: color-mix(in srgb, var(--status-success) 24%, transparent);
}

.badge-nomination-rejected,
.badge-nomination-ignored {
    color: var(--text-muted);
    background: color-mix(in srgb, var(--text-muted) 12%, transparent);
    border-color: color-mix(in srgb, var(--text-muted) 22%, transparent);
}

.nomination-confidence {
    display: inline-flex;
    align-items: center;
    min-width: 2.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.nomination-confidence--high { color: var(--status-success); }
.nomination-confidence--medium { color: var(--status-warning); }
.nomination-confidence--low { color: var(--status-danger); }

.nomination-review__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.nomination-review__source {
    margin-bottom: 1rem;
}

.nomination-grade-suggestions {
    margin: 0 0 1rem;
}

.nomination-grade-suggestions__icon {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    color: var(--status-warning-default);
}

.nomination-grade-suggestions__body {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    width: 100%;
}

.nomination-grade-suggestions__list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.nomination-grade-suggestions__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--status-warning-default) 24%, var(--border-subtle));
    border-radius: 0.6rem;
    background: color-mix(in srgb, var(--status-warning-surface-l1) 72%, var(--bg-surface));
}

.nomination-grade-suggestions__copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.nomination-grade-suggestions__copy strong,
.nomination-grade-suggestions__copy span {
    overflow-wrap: anywhere;
}

@media (max-width: 560px) {
    .nomination-grade-suggestions__item {
        align-items: stretch;
        flex-direction: column;
    }

    .nomination-grade-suggestions__item .btn {
        width: 100%;
    }
}

.nomination-review__email {
    border: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.24));
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: color-mix(in srgb, var(--surface-elevated, #fff) 92%, transparent);
}

.nomination-review__email-body {
    margin: 0.75rem 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.9rem;
    max-height: 220px;
    overflow: auto;
}

.nomination-review__images { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.nomination-review__image-link { color: inherit; font-size: .8125rem; text-decoration: none; overflow: hidden; }
.nomination-review__image { display: block; width: 100%; height: 150px; object-fit: cover; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 6px; }

.nomination-subject-cell strong {
    display: block;
}

/* Nominations mobile cards — dense hero + meta grid + pinned actions (no horizontal scroll) */
@media (max-width: 899px) {
    #view-nominations .page-results-shell,
    #view-nominations .glass-panel,
    #view-nominations .ds-table-card,
    #view-nominations .table-responsive {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    #view-nominations .data-table--nominations.ds-table,
    #view-nominations .data-table--nominations {
        display: block;
        width: 100% !important;
        max-width: 100%;
        min-width: 0 !important;
        table-layout: fixed;
    }

    #view-nominations .data-table--nominations tbody {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    #view-nominations .data-table--nominations tbody tr.nomination-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, auto);
        align-items: start;
        column-gap: var(--space-8);
        row-gap: var(--space-8);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: var(--space-10);
        padding: var(--space-12);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        background: var(--bg-surface);
        overflow: hidden;
    }

    #view-nominations .data-table--nominations tbody tr.nomination-card > td {
        display: block;
        width: auto;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 0;
        border-bottom: none;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    #view-nominations .data-table--nominations tbody tr.nomination-card > td::before {
        font-size: 10px;
        margin-bottom: 2px;
        letter-spacing: 0.03em;
    }

    #view-nominations .data-table--nominations .nomination-card__field--hero::before,
    #view-nominations .data-table--nominations .nomination-card__field--status::before,
    #view-nominations .data-table--nominations .nomination-card__field--confidence::before,
    #view-nominations .data-table--nominations .nomination-card__field--actions::before {
        display: none;
    }

    #view-nominations .data-table--nominations .nomination-card__field--hero {
        grid-column: 1;
        grid-row: 1;
        max-width: 100%;
    }

    #view-nominations .data-table--nominations .nomination-card__field--status {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
        width: max-content;
        max-width: 7.5rem;
    }

    #view-nominations .data-table--nominations .nomination-card__field--confidence {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
        margin-top: 1.85rem;
        width: max-content;
        max-width: 7.5rem;
        font-size: 0.85rem;
        font-weight: 600;
        text-align: right;
    }

    #view-nominations .data-table--nominations .nomination-card__field--received {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }

    #view-nominations .data-table--nominations .nomination-card__field--etb,
    #view-nominations .data-table--nominations .nomination-card__field--job {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }

    #view-nominations .data-table--nominations .nomination-card__field--from,
    #view-nominations .data-table--nominations .nomination-card__field--notes {
        grid-column: 1 / -1;
        grid-row: 3;
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }

    #view-nominations .data-table--nominations .nomination-card__field--actions {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: var(--space-4);
        padding-top: var(--space-10);
        border-top: 1px solid var(--border-subtle);
        width: 100%;
        max-width: 100%;
    }

    #view-nominations .data-table--nominations .nomination-subject-cell,
    #view-nominations .data-table--nominations .nomination-subject-cell strong,
    #view-nominations .data-table--nominations .nomination-subject-cell .text-muted,
    #view-nominations .data-table--nominations .nomination-subject-cell .text-sm {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    #view-nominations .data-table--nominations .nomination-subject-cell strong {
        font-size: 1rem;
        line-height: 1.25;
        color: var(--text-main);
    }

    #view-nominations .data-table--nominations .nomination-subject-cell .text-muted,
    #view-nominations .data-table--nominations .nomination-subject-cell .text-sm {
        font-size: 0.8125rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #view-nominations .data-table--nominations .nomination-card__field--actions .action-bar-inline {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--space-8);
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    /* Inbox: Review full width, then Accept | Reject */
    #view-nominations #nominationsInboxTable .nomination-card__field--actions .action-bar-inline > :first-child {
        grid-column: 1 / -1;
    }

    #view-nominations .data-table--nominations .nomination-card__field--actions .ds-btn,
    #view-nominations .data-table--nominations .nomination-card__field--actions .btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 44px;
        height: auto;
        justify-content: center;
        white-space: normal;
        box-sizing: border-box;
    }

    [data-theme="dark"] #view-nominations .data-table--nominations tbody tr.nomination-card {
        background: var(--bg-surface);
    }
}

.job-status-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.job-status-swatch--scheduled {
    background: var(--job-status-scheduled);
}

.job-status-swatch--in-progress {
    background: var(--job-status-in-progress);
}

.job-status-swatch--completed {
    background: var(--job-status-completed);
}

.job-status-swatch--issue {
    background: var(--job-status-issue);
}

.text-blue {
    color: var(--status-info);
    font-size: 18px;
}

.text-cyan {
    color: var(--text-brand);
    font-size: 18px;
}

.stat-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.stat-info h3 {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
}

.stat-info span {
    color: var(--text-muted);
    font-size: 13px;
}

.stat-card--compact .stat-info {
    gap: var(--space-2);
}

.stat-card--compact .stat-info h3 {
    font-size: 22px;
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.stat-card--compact .stat-info span {
    font-size: 12px;
    line-height: 1.35;
    max-width: 28ch;
}

.stat-label {
    color: var(--text-secondary) !important;
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 12px;
}

.text-danger {
    color: var(--status-danger);
}

.topbar-department-menu {
    position: relative;
    display: inline-flex;
}

.topbar-notification-menu__label {
    gap: 2px;
}

.topbar-notification-menu__label-main,
.topbar-department-menu__label-main {
    display: block;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.15;
}

.topbar-notification-menu__label-sub,
.topbar-department-menu__label-sub {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
}

.topbar-department-menu__caret {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
}

.topbar-department-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(320px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 98%, var(--bg-brand) 2%) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-lg);
}

.topbar-department-menu__item {
    --mode-accent: var(--text-brand);
    --mode-accent-soft: var(--bg-brand-soft);
    --mode-accent-border: var(--border-brand);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.topbar-department-menu__item[data-app-mode-option="planning"] {
    --mode-accent: #4b3fe3;
    --mode-accent-soft: color-mix(in srgb, #4b3fe3 10%, var(--bg-surface));
    --mode-accent-border: color-mix(in srgb, #4b3fe3 28%, var(--border-subtle));
}

.topbar-department-menu__item[data-app-mode-option="finance"] {
    --mode-accent: var(--status-success);
    --mode-accent-soft: color-mix(in srgb, var(--status-success) 10%, var(--bg-surface));
    --mode-accent-border: color-mix(in srgb, var(--status-success) 28%, var(--border-subtle));
}

.topbar-department-menu__item i {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--mode-accent-soft);
    color: var(--mode-accent);
    font-size: 18px;
}

.topbar-department-menu__item-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.topbar-department-menu__item-title {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.topbar-department-menu__item-subtitle {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
}

.topbar-department-menu__item-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.topbar-department-menu__item:hover {
    border-color: var(--mode-accent-border);
    background: var(--mode-accent-soft);
    transform: translateY(-1px);
}

.topbar-department-menu__item:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--mode-accent) 24%, transparent);
    outline-offset: 2px;
}

.topbar-department-menu__item.is-active {
    border-color: var(--mode-accent-border);
    background: var(--mode-accent-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mode-accent) 16%, transparent);
}

.topbar-department-menu__item.is-active i {
    color: var(--mode-accent);
}

.topbar-department-menu__item.is-active .topbar-department-menu__item-title {
    color: var(--mode-accent);
}

.topbar-department-menu__item.is-active .topbar-department-menu__item-badge {
    background: color-mix(in srgb, var(--mode-accent) 14%, var(--bg-surface));
    color: var(--mode-accent);
}

.topbar-create-menu {
    position: relative;
    display: inline-flex;
}

.topbar-create-menu__caret {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
}

.topbar-create-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(240px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 98%, var(--bg-brand) 2%) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-lg);
}

.topbar-create-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.topbar-create-menu__item i {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 18px;
}

.topbar-create-menu__item:hover {
    border-color: var(--border-subtle);
    background: var(--bg-neutral-soft);
    transform: translateY(-1px);
}

.topbar-mobile-menu {
    position: relative;
    display: none;
    align-items: center;
}

.topbar-mobile-menu__portal {
    position: fixed;
    inset: 0;
    z-index: var(--shell-z-sheet);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.topbar-mobile-menu__portal[hidden] {
    display: none !important;
}

.topbar-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--bg-overlay);
    cursor: pointer;
}

.topbar-mobile-menu__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(85vh, 720px);
    border: 1px solid var(--border-subtle);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 98%, var(--bg-brand) 2%) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.topbar-mobile-menu__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-16) var(--space-12);
    border-bottom: 1px solid var(--border-subtle);
    flex: 0 0 auto;
}

.topbar-mobile-menu__head-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-mobile-menu__head-copy strong {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 700;
}

.topbar-mobile-menu__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
}

.topbar-mobile-menu__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    min-height: 0;
    padding: var(--space-12) var(--space-16) calc(var(--space-16) + env(safe-area-inset-bottom, 0px));
    overflow: auto;
}

.topbar-search-sheet__portal {
    position: fixed;
    inset: 0;
    z-index: var(--shell-z-sheet);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.topbar-search-sheet__portal[hidden] {
    display: none !important;
}

.topbar-search-sheet__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--bg-overlay);
    cursor: pointer;
}

.topbar-search-sheet__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(70vh, 520px);
    border: 1px solid var(--border-subtle);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 98%, var(--bg-brand) 2%) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.topbar-search-sheet__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-16) var(--space-12);
    border-bottom: 1px solid var(--border-subtle);
    flex: 0 0 auto;
}

.topbar-search-sheet__head-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-search-sheet__head-copy strong {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 700;
}

.topbar-search-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
}

.topbar-search-sheet__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    min-height: 0;
    padding: var(--space-12) var(--space-16) calc(var(--space-16) + env(safe-area-inset-bottom, 0px));
}

.topbar-search-sheet__portal[data-bottom-sheet-viewport-synced="portal"] .topbar-search-sheet__panel {
    max-height: 100%;
}

.page-filters-panel[data-bottom-sheet-viewport-synced="panel"] {
    transition: bottom 0.15s ease, max-height 0.15s ease;
}

.header-search__form--sheet {
    display: flex !important;
    align-items: center;
    position: relative;
    width: 100%;
}

.header-search__form--sheet input {
    width: 100%;
    min-height: var(--toolbar-control-height);
}

.topbar-mobile-menu__section {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.topbar-mobile-menu__section-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-mobile-menu__item {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    width: 100%;
    min-height: 44px;
    padding: var(--space-10) var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.topbar-mobile-menu__item i {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 18px;
}

.topbar-mobile-menu__item-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-mobile-menu__item-title {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.topbar-mobile-menu__item-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.topbar-mobile-menu__item:hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
}

.topbar-mobile-menu__item--danger {
    color: var(--status-danger);
}

.topbar-mobile-menu__item--danger i {
    color: var(--status-danger);
}

.page-header-mobile-overflow {
    display: none;
}

.page-header-mobile-sheet__portal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.page-header-mobile-sheet__portal[hidden] {
    display: none !important;
}

.page-header-mobile-sheet__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--bg-overlay);
    cursor: pointer;
}

.page-header-mobile-sheet__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(70vh, 520px);
    border: 1px solid var(--border-subtle);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: var(--bg-surface);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.page-header-mobile-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-14) var(--space-16);
    border-bottom: 1px solid var(--border-subtle);
}

.page-header-mobile-sheet__head strong {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 700;
}

.page-header-mobile-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
}

.page-header-mobile-sheet__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
    padding: var(--space-12) var(--space-16) calc(var(--space-16) + env(safe-area-inset-bottom, 0px));
    overflow: auto;
}

.page-header-mobile-sheet__body .btn,
.page-header-mobile-sheet__body .ds-btn {
    width: 100%;
    justify-content: center;
}

@media (min-width: 900px) {
    .topbar-notification-menu__portal {
        position: static;
        inset: auto;
        display: block;
        z-index: auto;
        flex: 0 0 0;
        width: 0;
        min-width: 0;
        overflow: hidden;
        align-self: stretch;
        pointer-events: auto;
    }

    .topbar-notification-menu__portal[hidden] {
        display: block !important;
    }

    .topbar-notification-menu__panel {
        position: sticky;
        top: 0;
        width: var(--notification-drawer-width);
        height: 100vh;
        max-height: 100vh;
    }

    .topbar-notification-menu__drawer {
        width: auto;
        max-height: none;
        border-radius: 0;
        overflow: visible;
    }

    .topbar-notification-menu__body {
        max-height: none;
        overflow: auto;
    }
}

.topbar-notification-menu {
    position: relative;
    display: inline-flex;
}

.topbar-notification-menu__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--status-danger);
    color: var(--text-inverse);
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--status-danger) 30%, transparent);
}

.topbar-notification-menu__portal {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    align-self: stretch;
    transition: flex-basis var(--transition-base), width var(--transition-base);
}

.app-layout.is-notification-drawer-open .topbar-notification-menu__portal {
    flex: 0 0 var(--notification-drawer-width);
    width: var(--notification-drawer-width);
}

.topbar-notification-menu__panel {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: var(--notification-drawer-width);
    height: 100vh;
    max-height: 100vh;
    padding: 0;
    border-left: 1px solid var(--border-subtle);
    border-radius: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 98%, var(--bg-brand) 2%) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.topbar-notification-menu__drawer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
    padding: 16px;
}

.topbar-notification-menu__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    flex: 0 0 auto;
}

.topbar-notification-menu__head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.topbar-notification-menu__head-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-notification-menu__head-copy strong {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
}

.topbar-notification-menu__mark-all {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.topbar-notification-menu__mark-all:hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
}

.topbar-notification-menu__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.topbar-notification-menu__close:hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
}

.topbar-notification-menu__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.topbar-notification-menu__chip {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.topbar-notification-menu__chip:hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
    color: var(--text-main);
    transform: translateY(-1px);
}

.topbar-notification-menu__chip.is-active {
    background: var(--bg-brand-soft);
    border-color: color-mix(in srgb, var(--border-brand) 28%, transparent);
    color: var(--text-brand);
}

.topbar-notification-menu__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

.topbar-notification-menu__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.topbar-notification-menu__item {
    position: relative;
    width: 100%;
    padding: 12px 92px 12px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-surface);
    color: var(--text-main);
    text-align: left;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.topbar-notification-menu__item-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.topbar-notification-menu__item:hover {
    border-color: var(--border-default);
    background: var(--bg-neutral-soft);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.topbar-notification-menu__item.is-unread {
    border-color: color-mix(in srgb, var(--border-brand) 24%, transparent);
    background: linear-gradient(180deg, var(--bg-brand-soft), var(--bg-surface));
}

.topbar-notification-menu__item.is-selected {
    border-color: color-mix(in srgb, var(--border-brand) 42%, transparent);
    background: var(--bg-brand-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-brand) 18%, transparent);
}

.topbar-notification-menu__item.is-selected.is-unread {
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-brand-soft) 88%, var(--bg-surface)), var(--bg-brand-soft));
}

.topbar-notification-menu__item-action {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    background: var(--bg-menu);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.topbar-notification-menu__item:hover .topbar-notification-menu__item-action,
.topbar-notification-menu__item:focus-within .topbar-notification-menu__item-action {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.topbar-notification-menu__item-action:hover {
    border-color: var(--border-default);
    color: var(--text-main);
    background: var(--bg-neutral-soft);
}

.topbar-notification-menu__item-action--read {
    color: var(--status-success);
}

.topbar-notification-menu__item-action--clear {
    color: var(--status-danger);
}

.topbar-notification-menu__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    font-size: 18px;
}

.topbar-notification-menu__content {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 4px;
}

.topbar-notification-menu__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
}

.topbar-notification-menu__title {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.topbar-notification-menu__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    color: var(--text-secondary);
    font-size: 11px;
}

.topbar-notification-menu__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.topbar-notification-menu__dot--unread {
    background: var(--status-danger);
}

.topbar-notification-menu__summary {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.topbar-notification-menu__empty {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.topbar-notification-menu__empty[hidden] {
    display: none !important;
}

.topbar-notification-menu__empty p {
    margin: 0;
}

.notification-history__stats {
    margin-bottom: 16px;
}

.notification-history-archive-modal {
    display: grid;
    gap: var(--space-16);
}

.notification-history-archive-modal__stats {
    margin-top: 16px;
}

.notification-history-archive-modal__stats .kpi-grid {
    margin-bottom: 0;
}

.notification-history__title {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.notification-history__summary {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
    margin-top: 2px;
}

.feedback-review-screenshot {
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: inherit;
    display: inline-flex;
    gap: 8px;
    margin-bottom: 8px;
    max-width: 100%;
    padding: 6px 8px;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.feedback-review-screenshot:hover,
.feedback-review-screenshot:focus-visible {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
    color: inherit;
    transform: translateY(-1px);
}

.feedback-review-screenshot__thumb {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    flex: 0 0 auto;
    height: 38px;
    object-fit: cover;
    width: 56px;
}

.feedback-review-screenshot__badge {
    flex: 0 0 auto;
    white-space: nowrap;
}

.feedback-review-screenshot + .notification-history__title {
    margin-top: 0;
}


.notification-history__row--archived {
    opacity: 0.7;
}

@media (max-width: 720px) {
    .kpi-grid--carousel {
        gap: var(--space-10);
    }

    .kpi-grid--carousel .kpi-grid__controls {
        display: flex;
    }

    .kpi-grid--carousel .kpi-grid__control {
        width: 32px;
        height: 32px;
    }

    .kpi-grid--carousel .kpi-grid__viewport {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .kpi-grid--carousel .kpi-grid__viewport::-webkit-scrollbar {
        display: none;
    }

    .kpi-grid--carousel .kpi-grid__track {
        display: flex;
        gap: var(--space-16);
        width: max-content;
        min-width: 100%;
    }

    .kpi-grid--carousel .kpi-grid__track > .stat-card {
        flex: 0 0 100%;
        scroll-snap-align: start;
    }

    .topbar-notification-menu__item {
        padding-right: 12px;
    }

    .topbar-notification-menu__item-action {
        position: static;
        margin-top: 10px;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .topbar-notification-menu__item {
        display: grid;
        gap: 10px;
    }

    .topbar-notification-menu__meta {
        gap: 4px 6px;
    }

    .notification-history-archive-modal__stats {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
}

.topbar-notification-menu__severity {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.topbar-notification-menu__severity--info {
    background: var(--bg-brand-soft);
    color: var(--text-brand);
}

.topbar-notification-menu__severity--success {
    background: var(--status-success-soft);
    color: var(--status-success);
}

.topbar-notification-menu__severity--warning {
    background: var(--status-warning-soft);
    color: var(--status-warning);
}

.topbar-notification-menu__severity--critical {
    background: var(--status-danger-soft);
    color: var(--status-danger);
}

.topbar-notification-menu__empty {
    padding: 24px 16px;
    border: 1px dashed var(--border-subtle);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    background: var(--bg-surface);
}

.user-menu {
    position: relative;
    display: inline-flex;
}

.user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-10);
    min-height: 40px;
    max-width: min(280px, 42vw);
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.user-menu__trigger:hover {
    background: var(--bg-neutral-soft);
    border-color: var(--border-default);
}

.user-menu__chip {
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-brand-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-menu__chip-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu__chip-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-brand);
}

.user-menu__chip-image + .user-menu__chip-text {
    display: none;
}

.user-menu__label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
    line-height: 1.1;
}

.user-menu__label-prefix {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
}

.user-menu__label-name {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.user-menu__caret {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 14px;
}

.user-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(300px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 98%, var(--bg-brand) 2%) 0%, var(--bg-surface) 100%);
    box-shadow: var(--shadow-lg);
}

.user-menu__greeting {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 12px;
}

.user-menu__greeting strong {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

.user-menu__release-switcher {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.user-menu__release-switcher--mobile {
    margin: 0 4px 8px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--bg-neutral-soft);
}

.user-menu__release-switcher-label {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.user-menu__release-switcher-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.user-menu__release-option {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.user-menu__release-option:hover {
    border-color: var(--border-default);
    background: var(--bg-neutral-soft);
}

.user-menu__release-option.is-active {
    border-color: color-mix(in srgb, var(--border-brand) 28%, transparent);
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-brand) 16%, transparent);
}

.user-menu__release-switcher.is-busy {
    opacity: 0.72;
    pointer-events: none;
}

.user-menu__release-switcher.is-busy .user-menu__release-switcher-options {
    position: relative;
}

.user-menu__release-switcher.is-busy .user-menu__release-switcher-options::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-surface) 35%, transparent);
}

.user-menu__preferences {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 4px 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.user-menu__preferences--mobile {
    padding: 0;
    border-bottom: 0;
}

.user-menu__preferences-label {
    padding: 0 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.user-menu-pref-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-surface) 92%, var(--bg-neutral-soft) 8%);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.user-menu-pref-card:has(#topbarOfflineModeInput:checked),
.user-menu-pref-card:has(#topbarOfflineModeInputMobile:checked) {
    border-color: color-mix(in srgb, var(--color-brand, #2563eb) 35%, var(--border-subtle));
    background: color-mix(in srgb, var(--bg-brand-soft) 55%, var(--bg-surface) 45%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-brand, #2563eb) 12%, transparent);
}

.user-menu-pref-card--theme {
    grid-template-columns: auto 1fr;
}

.user-menu-pref-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 17px;
    flex-shrink: 0;
}

.user-menu-pref-card__icon--offline {
    color: var(--text-brand);
    background: color-mix(in srgb, var(--bg-brand-soft) 80%, var(--bg-surface) 20%);
}

.user-menu-pref-card__icon--theme {
    color: var(--text-secondary);
    background: var(--bg-neutral-soft);
}

.user-menu-pref-card:has(#topbarOfflineModeInput:checked) .user-menu-pref-card__icon--offline,
.user-menu-pref-card:has(#topbarOfflineModeInputMobile:checked) .user-menu-pref-card__icon--offline {
    color: var(--color-brand, #2563eb);
    background: color-mix(in srgb, var(--color-brand, #2563eb) 16%, var(--bg-surface) 84%);
}

.user-menu-pref-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.user-menu-pref-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-menu-pref-card__title {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.user-menu-pref-card__status {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-neutral-soft);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.user-menu-pref-card:has(#topbarOfflineModeInput:checked) .user-menu-pref-card__status,
.user-menu-pref-card:has(#topbarOfflineModeInputMobile:checked) .user-menu-pref-card__status {
    background: color-mix(in srgb, var(--color-brand, #2563eb) 18%, var(--bg-surface) 82%);
    color: var(--color-brand, #2563eb);
}

.user-menu-pref-card__hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.45;
}

.user-menu-pref-card__switch {
    flex-shrink: 0;
    margin: 2px 0 0;
}

.user-menu-theme-segment {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 6px;
    padding: 3px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-neutral-soft);
}

.user-menu-theme-segment__option {
    min-height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.user-menu-theme-segment__option:hover {
    color: var(--text-main);
    background: color-mix(in srgb, var(--bg-surface) 70%, transparent);
}

.user-menu-theme-segment__option.is-active {
    color: var(--text-main);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.user-menu-theme-segment__option:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-brand, #2563eb) 55%, transparent);
    outline-offset: 1px;
}

[data-theme="dark"] .user-menu-pref-card {
    background: color-mix(in srgb, var(--bg-surface) 88%, var(--bg-neutral-soft) 12%);
}

[data-theme="dark"] .user-menu-pref-card:has(#topbarOfflineModeInput:checked),
[data-theme="dark"] .user-menu-pref-card:has(#topbarOfflineModeInputMobile:checked) {
    background: color-mix(in srgb, var(--bg-brand-soft) 35%, var(--bg-surface) 65%);
}

[data-theme="dark"] .user-menu-theme-segment__option.is-active {
    background: color-mix(in srgb, var(--bg-surface) 85%, white 15%);
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.user-menu__item i {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 18px;
}

.user-menu__item:hover {
    border-color: var(--border-subtle);
    background: var(--bg-neutral-soft);
}

.user-menu__item--danger {
    color: var(--status-danger);
}

.user-menu__item--danger i {
    color: var(--status-danger);
}

.user-menu__item--danger:hover {
    background: var(--status-danger-soft);
    border-color: color-mix(in srgb, var(--status-danger) 20%, transparent);
}

.topbar-department-menu__panel[hidden],
.topbar-create-menu__panel[hidden],
.topbar-notification-menu__panel[hidden],
.user-menu__panel[hidden] {
    display: none !important;
}

@media (max-width: 899px) {
    .app-header {
        flex-wrap: nowrap;
        gap: var(--space-8);
    }

    .mobile-header-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-search {
        flex: 0 0 auto;
        max-width: none;
    }

    .header-search__form {
        display: none;
    }

    .header-search__mobile-trigger {
        display: inline-flex;
    }

    .header-actions {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        margin-left: 0;
    }

    .topbar-desktop-only {
        display: none !important;
    }

    .topbar-mobile-menu {
        display: inline-flex;
    }

    body.is-topbar-mobile-menu-open,
    body.is-page-header-mobile-sheet-open,
    body.is-topbar-search-sheet-open {
        overflow: hidden;
    }

    .topbar-department-menu__panel {
        min-width: 260px;
    }

    /* Keep phone layouts from growing wider than the viewport.
       Horizontal overflow is the main cause of “stuck” vertical scroll + right-side empty strips. */
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    .app-layout,
    .main-wrapper,
    .content-container,
    .view-section.active,
    .page-tab-panel,
    .page-results-shell,
    .page-filters-shell,
    .data-grid {
        min-width: 0;
        max-width: 100%;
    }

    .content-container {
        width: 100%;
        overflow-x: clip;
        box-sizing: border-box;
    }

    .data-card {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .data-card__header {
        flex-wrap: wrap;
        row-gap: var(--space-8);
    }

    .data-card__title {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .data-card__actions,
    .data-card__actions.action-bar-inline {
        flex: 1 1 auto;
        justify-content: flex-start;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .page-header__actions,
    .page-header__actions-group {
        max-width: 100%;
        min-width: 0;
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .input-grid {
        grid-template-columns: 1fr;
    }

    .input-grid .input-group.half {
        grid-column: span 1;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-16);
    }

    .page-header__actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }

    .page-header__action--overflow {
        display: none !important;
    }

    .page-header-mobile-overflow {
        display: inline-flex;
    }

    .page-tabs__viewport {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .page-tabs__viewport::-webkit-scrollbar {
        display: none;
    }

    .page-tabs__track {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    .page-tabs__track .page-tabs__tab {
        flex: 0 0 auto;
        min-width: auto;
        scroll-snap-align: start;
    }

    .page-tabs__control {
        width: 36px;
        min-width: 36px;
        height: 44px;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .release-footer {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .release-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: var(--space-8);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .release-footer__copyright,
    .release-footer__brand,
    .release-footer__meta {
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .release-footer__meta {
        flex-basis: auto;
        text-align: left;
    }

    .user-menu__label,
    .topbar-department-menu__label-sub {
        display: none;
    }

    .topbar-notification-menu__label {
        display: none;
    }

    .topbar-action--menu,
    .user-menu__trigger {
        min-width: 40px;
        padding-inline: 10px;
    }

    .topbar-notification-menu__portal {
        position: fixed;
        inset: 0;
        z-index: var(--shell-z-sheet);
        flex: none;
        width: auto;
        overflow: visible;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        pointer-events: none;
        background: transparent;
    }

    .topbar-notification-menu__portal[hidden] {
        display: none !important;
        pointer-events: none !important;
        background: transparent !important;
    }

    body.is-notification-drawer-open .topbar-notification-menu__portal:not([hidden]),
    .app-layout.is-notification-drawer-open .topbar-notification-menu__portal:not([hidden]) {
        flex: none;
        width: auto;
        pointer-events: auto;
    }

    .analytics-card,
    .analytics-grid > .analytics-card,
    .analytics-grid > .analytics-card.analytics-card--half,
    .analytics-grid > .analytics-card.analytics-card--third,
    .analytics-grid > .analytics-card.analytics-card--full,
    .analytics-grid > .analytics-card.analytics-card--wide {
        grid-column: span 12;
    }

    .analytics-card {
        min-height: 0;
    }

    .account-profile__identity {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .donut-wrap {
        grid-template-columns: 1fr;
    }

    .topbar-notification-menu__panel {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        max-height: none;
    }
}

@media (max-width: 899px) {
    .topbar-notification-menu__drawer {
        width: 100%;
        max-height: min(85vh, 720px);
        border-radius: 20px 20px 0 0;
        overflow: hidden;
    }

    .topbar-notification-menu__body {
        max-height: min(50vh, 400px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.invoice-list-toolbar {
    margin-bottom: var(--space-12);
    padding: var(--space-14);
}

.invoice-list-toolbar__filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 0.8fr);
    gap: var(--space-12);
}

.invoice-list-toolbar__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.invoice-list-toolbar__label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.invoice-detail-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
}

.invoice-detail-card {
    padding: var(--space-18);
}

.invoice-detail-card--wide {
    grid-column: 1 / -1;
}

.invoice-detail-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

.invoice-detail-card__eyebrow {
    margin: 0 0 var(--space-4);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.invoice-detail-card__title {
    margin: 0;
    color: var(--text-main);
    font-size: 20px;
    font-weight: 700;
}

.invoice-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
    margin: 0 0 var(--space-16);
}

.invoice-detail-meta div {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.invoice-detail-meta dt {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.invoice-detail-meta dd {
    margin: 0;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

.invoice-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-brand);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.link-button:hover {
    text-decoration: underline;
}

@media (max-width: 899px) {
    .invoice-list-toolbar__filters,
    .invoice-detail-grid,
    .invoice-detail-meta {
        grid-template-columns: 1fr;
    }
}

.finance-export-panel__grid {
    display: grid;
    gap: var(--space-32);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-export-card {
    display: grid;
    gap: var(--space-12);
    align-content: start;
    min-width: 0;
}

.finance-export-card .section-title {
    margin: 0;
}

.finance-export-card + .finance-export-card {
    padding-left: var(--space-24);
    border-left: 1px solid var(--border-subtle);
}

.finance-settings-form .input-grid {
    gap: var(--space-4);
}

@media (max-width: 899px) {
    .finance-export-panel__grid {
        grid-template-columns: 1fr;
    }

    .finance-export-card + .finance-export-card {
        padding-left: 0;
        padding-top: var(--space-24);
        border-left: 0;
        border-top: 1px solid var(--border-subtle);
    }
}

.global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
    box-sizing: border-box;
    background: color-mix(in srgb, var(--bg-overlay) 88%, var(--bg-surface) 12%);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.global-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.global-loading-overlay__panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    width: min(100%, 420px);
    max-width: 100%;
    box-sizing: border-box;
    padding: var(--space-20) var(--space-24);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
}

.global-loading-overlay__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.global-loading-overlay__copy strong {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.global-loading-overlay__copy span {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.global-loading-overlay--mode-transition .global-loading-overlay__panel {
    width: min(100%, 420px);
    border-color: color-mix(in srgb, var(--border-brand) 24%, var(--border-subtle));
    box-shadow: 0 24px 60px color-mix(in srgb, var(--bg-brand) 16%, transparent);
    align-items: center;
}

.global-loading-overlay--mode-transition [data-global-loading-default] {
    display: none !important;
}

.global-loading-overlay:not(.global-loading-overlay--mode-transition) [data-global-loading-mode-transition] {
    display: none !important;
}

.global-loading-overlay__mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--bg-brand-soft);
    color: var(--text-brand);
    font-size: 24px;
}

.global-loading-overlay--mode-finance .global-loading-overlay__mode-badge {
    background: color-mix(in srgb, var(--status-success) 14%, var(--bg-surface));
    color: var(--status-success);
}

.global-loading-overlay--mode-planning .global-loading-overlay__mode-badge {
    background: var(--bg-brand-soft);
    color: var(--text-brand);
}

.global-loading-overlay--mode-transition .global-loading-overlay__spinner--mode {
    border-top-color: var(--text-brand);
}

.global-loading-overlay--mode-finance.global-loading-overlay--mode-transition .global-loading-overlay__spinner--mode {
    border-top-color: var(--status-success);
}

.global-loading-overlay__default {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    width: 100%;
}

.global-loading-overlay__header {
    display: flex;
    align-items: center;
    gap: var(--space-16);
    min-width: 0;
}

.global-loading-overlay__progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding-left: calc(44px + var(--space-16));
    box-sizing: border-box;
}

.global-loading-overlay__progress {
    width: 100%;
}

.global-loading-overlay__progress-track {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.global-loading-overlay__progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--bg-brand-strong), color-mix(in srgb, var(--bg-brand-strong) 72%, white));
    transition: width 0.24s ease;
}

.global-loading-overlay__progress-wrap.is-indeterminate .global-loading-overlay__progress-bar {
    width: 38%;
    animation: globalLoadingIndeterminate 1.1s ease-in-out infinite;
}

.global-loading-overlay__progress-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: right;
}

@keyframes globalLoadingIndeterminate {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(320%);
    }
}

@keyframes loadingSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ss-spinner,
    .global-loading-overlay,
    .global-loading-overlay__spinner,
    .global-loading-overlay__progress-bar {
        animation-duration: 1ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }

    .ss-spinner,
    .global-loading-overlay__spinner {
        animation: none;
    }

    .global-loading-overlay__progress-wrap.is-indeterminate .global-loading-overlay__progress-bar {
        animation: none;
        width: 45%;
    }
}

@media (max-width: 560px) {
    .global-loading-overlay__progress-wrap {
        padding-left: 0;
    }
}

@media (min-width: 900px) {
    .global-loading-overlay {
        left: var(--sidebar-width);
    }
}

.invoice-detail-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
}

.invoice-detail-form .input-group.full {
    grid-column: 1 / -1;
}

.invoice-payment-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
    margin-top: var(--space-12);
}

.invoice-payment-history {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
    margin-top: var(--space-12);
}

.invoice-payment-history__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-neutral-soft);
}

@media (max-width: 899px) {
    .invoice-detail-form,
    .invoice-payment-form {
        grid-template-columns: 1fr;
    }
}

body[data-app-mode="finance"] [data-app-mode="planning"],
body[data-app-mode="planning"] [data-app-mode="finance"],
.is-app-mode-hidden {
    display: none !important;
}

body[data-app-mode="finance"] .sidebar-section[data-app-mode="planning"],
body[data-app-mode="planning"] .sidebar-section[data-app-mode="finance"] {
    display: none !important;
}

.global-loading-overlay__mode-transition {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-14);
    width: 100%;
    text-align: center;
}

.global-loading-overlay__mode-title {
    display: block;
    color: var(--text-main);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.global-loading-overlay__mode-message {
    display: block;
    max-width: 34ch;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.global-loading-overlay__spinner--mode {
    width: 34px;
    height: 34px;
    border: 3px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
    border-top-color: var(--text-brand);
    border-radius: 50%;
    animation: global-loading-spin 0.8s linear infinite;
}

.global-loading-overlay--mode-finance .global-loading-overlay__spinner--mode {
    border-top-color: var(--status-success);
}

@keyframes global-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.finance-client-brand {
    display: flex;
    align-items: center;
    gap: var(--spacer-8);
    min-width: 0;
}

.finance-client-brand .client-brand-mark {
    flex-shrink: 0;
}

/* ==========================================
   Mobile Table Card View (899px tablet, 720px phone)
========================================== */

@media (max-width: 899px) {
    .ds-table-card,
    .table-responsive {
        overflow-x: visible;
        border-radius: var(--radius-md);
        padding: 0;
    }

    .ds-table,
    .data-table,
    .planning-excel-table {
        display: block;
        min-width: 0;
    }

    .ds-table thead,
    .data-table thead,
    .planning-excel-table thead {
        display: none;
    }

    .ds-table tbody,
    .data-table tbody,
    .planning-excel-table tbody {
        display: block;
    }

    .ds-table tr,
    .data-table tr,
    .planning-excel-table tr {
        display: block;
        margin-bottom: var(--space-12);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        background: var(--bg-surface);
        overflow: hidden;
    }

    .ds-table td,
    .data-table td,
    .planning-excel-table td {
        display: block;
        width: 100%;
        padding: var(--space-12) var(--space-14);
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
        position: relative;
        white-space: normal;
    }

    .ds-table td:last-child,
    .data-table td:last-child,
    .planning-excel-table td:last-child {
        border-bottom: none;
    }

    .ds-table td::before,
    .data-table td::before,
    .planning-excel-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        margin-bottom: var(--space-4);
    }

    .ds-table td.num,
    .data-table td.num,
    .planning-excel-table td.num {
        text-align: left;
        font-family: inherit;
        font-variant-numeric: normal;
    }

    .input-password__toggle {
        width: 44px;
        height: 44px;
    }

    .header-search__mobile-trigger,
    .topbar-action--icon-only,
    .topbar-mobile-menu__trigger {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }
}

/* Dashboard Recent Activity — mobile stacked job cards (no horizontal scroll) */
@media (max-width: 899px) {
    .dashboard-activity-panel,
    .dashboard-activity-panel .dashboard-activity-table-shell,
    .dashboard-activity-panel .dashboard-activity-table-scroll {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    .dashboard-activity-panel .dashboard-activity-table-scroll {
        max-height: none;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .dashboard-activity-panel .dashboard-activity-table.data-table {
        display: block;
        width: 100% !important;
        max-width: 100%;
        min-width: 0 !important;
        table-layout: fixed;
    }

    .dashboard-activity-panel .dashboard-activity-table thead {
        display: none;
    }

    .dashboard-activity-panel .dashboard-activity-table tbody {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    .dashboard-activity-panel .dashboard-activity-table tbody tr.dashboard-activity-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, auto);
        grid-template-areas:
            "ref status"
            "vessel vessel"
            "loc loc"
            "hours date"
            "surveyor surveyor";
        align-items: start;
        column-gap: var(--space-10);
        row-gap: var(--space-6);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: var(--space-10);
        padding: var(--space-14) var(--space-16);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        background: var(--bg-surface);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
        cursor: pointer;
    }

    .dashboard-activity-panel .dashboard-activity-table tbody tr.dashboard-activity-row:last-child {
        margin-bottom: 0;
    }

    .dashboard-activity-panel .dashboard-activity-table tbody tr.dashboard-activity-row > td.dashboard-activity-col {
        display: block;
        width: auto;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 0;
        border-bottom: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-align: left;
    }

    .dashboard-activity-panel .dashboard-activity-table tbody tr.dashboard-activity-row > td.dashboard-activity-col::before {
        display: none;
        content: none;
    }

    .dashboard-activity-panel .dashboard-activity-col--ref {
        grid-area: ref;
        align-self: center;
        min-width: 0;
        padding-right: var(--space-8);
    }

    .dashboard-activity-panel .dashboard-activity-col--status {
        grid-area: status;
        justify-self: end;
        align-self: center;
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-activity-panel .dashboard-activity-col--status .badge {
        max-width: 100%;
    }

    .dashboard-activity-panel .dashboard-activity-col--vessel {
        grid-area: vessel;
        grid-column: 1 / -1;
    }

    .dashboard-activity-panel .dashboard-activity-col--location {
        grid-area: loc;
        grid-column: 1 / -1;
        color: var(--text-muted);
        font-size: 12px;
        line-height: 1.45;
    }

    .dashboard-activity-panel .dashboard-activity-col--hours {
        grid-area: hours;
        justify-self: start;
        align-self: center;
        color: var(--text-muted);
        font-size: 12px;
        white-space: nowrap;
    }

    .dashboard-activity-panel .dashboard-activity-col--date {
        grid-area: date;
        justify-self: end;
        align-self: center;
        color: var(--text-muted);
        font-size: 12px;
        white-space: nowrap;
    }

    .dashboard-activity-panel .dashboard-activity-col--surveyor {
        grid-area: surveyor;
        grid-column: 1 / -1;
        padding-top: var(--space-8);
        margin-top: var(--space-2);
        border-top: 1px solid var(--border-subtle);
    }

    .dashboard-activity-panel .dashboard-activity-job-ref {
        font-size: 13px;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .dashboard-activity-panel .dashboard-activity-cell-stack {
        gap: var(--space-4);
    }

    .dashboard-activity-panel .dashboard-activity-cell-stack strong {
        font-size: 14px;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .dashboard-activity-panel .dashboard-activity-client,
    .dashboard-activity-panel .dashboard-activity-surveyor {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .dashboard-activity-panel .dashboard-activity-client > :not(.client-brand-mark):not(.client-identity-avatar),
    .dashboard-activity-panel .dashboard-activity-surveyor > span:last-child {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .dashboard-activity-panel .dashboard-activity-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-activity-panel .dashboard-activity-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Roles & Permissions — in-page role editor */
.system-role-workspace {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: var(--space-20);
    align-items: start;
}

.system-role-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.system-role-list__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "main actions"
        "meta actions";
    gap: 6px var(--space-10);
    align-items: start;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.system-role-list__item:hover {
    border-color: color-mix(in srgb, var(--border-brand) 22%, var(--border-subtle));
}

.system-role-list__item:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--border-brand) 55%, transparent);
    outline-offset: 2px;
}

.system-role-list__item.is-active {
    border-color: color-mix(in srgb, var(--border-brand) 34%, var(--border-subtle));
    background: color-mix(in srgb, var(--bg-brand) 6%, var(--bg-surface));
    box-shadow: var(--shadow-md);
}

.system-role-list__main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.system-role-list__name {
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.25;
}

.system-role-list__slug {
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    word-break: break-word;
}

.system-role-list__desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.system-role-list__meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.system-role-list__actions {
    grid-area: actions;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.system-role-list__actions .action-bar-inline {
    margin: 0;
    gap: 6px;
}

.system-role-workspace__editor {
    min-width: 0;
}

.system-role-editor-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: var(--space-24);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
}

.system-role-editor-empty[hidden],
.system-role-editor[hidden] {
    display: none !important;
}

.system-role-editor {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    padding: var(--space-20);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.system-role-editor__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
    flex-wrap: wrap;
}

.system-role-editor__title-block {
    min-width: 0;
}

.system-role-editor__title-block .section-title {
    margin: 0;
}

.system-role-editor__title-block .text-muted {
    margin: 4px 0 0;
}

/* Shared collapsible settings section cards */
.settings-section-card.is-collapsible {
    gap: var(--space-12);
}

.settings-section-card__toggle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.settings-section-card__toggle:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--border-brand) 55%, transparent);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

.settings-section-card__head-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    min-width: 0;
}

.settings-section-card__head-copy .section-title,
.settings-section-card__head-copy .text-muted {
    margin: 0;
}

.settings-section-card__chevron {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 16px;
    transition: transform var(--transition-fast, .15s);
}

.settings-section-card.is-collapsed .settings-section-card__chevron {
    transform: rotate(-90deg);
}

.settings-section-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    min-width: 0;
}

.settings-section-card__body[hidden] {
    display: none !important;
}

.system-role-editor__toolbar {
    display: grid;
    gap: var(--space-12);
}

.system-role-editor__search {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    min-height: var(--toolbar-control-height, 40px);
    padding: 0 var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-neutral-soft);
    color: var(--text-muted);
}

.system-role-editor__search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    outline: none;
}

.system-role-editor__toolbar .system-access-toggle-card {
    margin: 0;
}

.system-role-editor__actions {
    justify-content: flex-end;
    margin-top: 0;
    padding-top: var(--space-12);
    border-top: 1px solid var(--border-subtle);
}

.system-access-permissions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
}

.system-access-permission-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
    padding: var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--bg-neutral-soft) 55%, var(--bg-surface));
}

.system-access-permission-group[data-system-access-group="pages"] {
    grid-column: 1 / -1;
}

.system-access-permission-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-10);
}

.system-access-permission-group__toggle {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.system-access-permission-group__toggle > i {
    color: var(--text-muted);
    flex: 0 0 auto;
}

.system-access-permission-group__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.system-access-permission-group__copy strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.25;
}

.system-access-permission-group__copy span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.system-access-permission-group__meta {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--space-10);
}

.system-access-permission-group__count {
    flex: 0 0 auto;
}

.system-access-permission-group__meta-sep {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1;
    user-select: none;
}

.system-access-permission-group__switch {
    flex: 0 0 auto;
}

.system-access-permission-group__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.system-access-permission {
    display: flex;
    align-items: flex-start;
    gap: var(--space-8);
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    cursor: pointer;
}

.system-access-permission[hidden] {
    display: none !important;
}

.system-access-permission__control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-top: 1px;
}

.system-access-permission__control input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--bg-brand);
    cursor: pointer;
}

.system-access-permission__copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.system-access-permission__copy strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.3;
}

.system-access-permission__copy small {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
    word-break: break-word;
}

[data-theme="dark"] .system-role-editor,
[data-theme="dark"] .system-role-editor-empty,
[data-theme="dark"] .system-access-permission,
[data-theme="dark"] .system-role-list__item {
    background: var(--bg-surface);
}

[data-theme="dark"] .system-role-list__item.is-active {
    background: color-mix(in srgb, var(--bg-brand) 10%, var(--bg-surface));
}

[data-theme="dark"] .system-access-permission-group {
    background: color-mix(in srgb, var(--bg-overlay-l3) 35%, var(--bg-surface));
}

[data-theme="dark"] .system-role-editor__search {
    background: var(--bg-overlay-l3);
}

@media (max-width: 1099px) {
    .system-role-workspace {
        grid-template-columns: 1fr;
    }

    .system-role-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: var(--space-10);
    }
}

@media (max-width: 799px) {
    .system-access-permissions,
    .system-access-permission-group__list {
        grid-template-columns: 1fr;
    }
}

/* Roadmap phase / sub-phase dialogs */
#systemFeedbackRoadmapPhaseManager .settings-section-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
}

#systemFeedbackRoadmapCards {
    align-items: stretch;
}

.analytics-card.roadmap-phase-card-shell {
    min-height: 0;
    gap: var(--space-14);
}

.analytics-card.roadmap-phase-card-shell .analytics-card__body {
    align-items: flex-start;
}

.analytics-card.roadmap-phase-card-shell .analytics-card__footer {
    flex-wrap: wrap;
    row-gap: var(--space-10);
    margin-top: auto;
    padding-top: var(--space-16);
}

.roadmap-phase-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-14);
    width: 100%;
}

.roadmap-phase-card__description {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.roadmap-phase-card__section {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.roadmap-phase-card__section-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.roadmap-phase-card__subphases {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.roadmap-phase-card__items {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.roadmap-phase-card__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-10);
    min-height: 36px;
    padding: var(--space-8) var(--space-10);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg-overlay-l3) 35%, var(--bg-surface));
}

.roadmap-phase-card__item-title {
    min-width: 0;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roadmap-phase-card__item-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

.roadmap-phase-card__item-index {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.feedback-phase-item-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.feedback-status-select {
    --feedback-status-accent: var(--text-brand);
    --feedback-status-surface: var(--bg-brand-soft);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 32px;
    padding: 0 28px 0 8px;
    border: 1px solid color-mix(in srgb, var(--feedback-status-accent) 28%, var(--border-subtle));
    border-radius: 999px;
    background: var(--feedback-status-surface);
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
}

.feedback-status-select:hover {
    border-color: color-mix(in srgb, var(--feedback-status-accent) 45%, var(--border-default));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--feedback-status-accent) 12%, transparent);
}

.feedback-status-select:focus-within {
    outline: 2px solid color-mix(in srgb, var(--feedback-status-accent) 45%, transparent);
    outline-offset: 1px;
}

.feedback-status-select.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

.feedback-status-select__icon {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--feedback-status-accent);
    font-size: 14px;
    pointer-events: none;
}

.feedback-status-select__control {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 28px 0 32px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feedback-status-select__control:focus {
    outline: none;
}

.feedback-status-select__control::-ms-expand {
    display: none;
}

.feedback-status-select__caret {
    position: absolute;
    right: 10px;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    color: var(--feedback-status-accent);
    font-size: 12px;
    pointer-events: none;
}

.feedback-status-select[data-feedback-status="requested"] {
    --feedback-status-accent: var(--text-brand);
    --feedback-status-surface: var(--bg-brand-soft);
}

.feedback-status-select[data-feedback-status="in_progress"] {
    --feedback-status-accent: var(--status-warning-default, #b45309);
    --feedback-status-surface: var(--status-warning-surface-l1, color-mix(in srgb, #f59e0b 18%, var(--bg-surface)));
}

.feedback-status-select[data-feedback-status="implemented_testing"] {
    --feedback-status-accent: var(--status-info-default, #0284c7);
    --feedback-status-surface: var(--status-info-surface-l1, color-mix(in srgb, #0ea5e9 18%, var(--bg-surface)));
}

.feedback-status-select[data-feedback-status="implemented_tested"] {
    --feedback-status-accent: var(--status-success-default, #15803d);
    --feedback-status-surface: var(--status-success-surface-l1, color-mix(in srgb, #22c55e 18%, var(--bg-surface)));
}

.feedback-status-select[data-feedback-status="blocked"] {
    --feedback-status-accent: var(--status-error-default, #b91c1c);
    --feedback-status-surface: var(--status-error-surface-l1, color-mix(in srgb, #ef4444 18%, var(--bg-surface)));
}

[data-theme="dark"] .feedback-status-select {
    background: color-mix(in srgb, var(--feedback-status-surface) 55%, var(--bg-surface) 45%);
}

.feedback-roadmap-graph {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    width: 100%;
}

.feedback-roadmap-graph__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
    color: var(--text-muted);
    font-size: 12px;
}

.feedback-roadmap-graph__legend span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
}

.feedback-roadmap-graph__legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.feedback-roadmap-graph__legend-dot--requested,
.feedback-roadmap-graph__stage--requested {
    --feedback-stage-color: var(--text-brand);
}

.feedback-roadmap-graph__legend-dot--in_progress,
.feedback-roadmap-graph__stage--in_progress {
    --feedback-stage-color: var(--status-warning);
}

.feedback-roadmap-graph__legend-dot--implemented_testing,
.feedback-roadmap-graph__stage--implemented_testing {
    --feedback-stage-color: var(--status-info);
}

.feedback-roadmap-graph__legend-dot--implemented_tested,
.feedback-roadmap-graph__stage--implemented_tested {
    --feedback-stage-color: var(--status-success);
}

.feedback-roadmap-graph__legend-dot--requested,
.feedback-roadmap-graph__legend-dot--in_progress,
.feedback-roadmap-graph__legend-dot--implemented_testing,
.feedback-roadmap-graph__legend-dot--implemented_tested {
    background: var(--feedback-stage-color);
}

.feedback-roadmap-graph__row {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(360px, 2fr) minmax(72px, 0.35fr);
    align-items: center;
    gap: var(--space-16);
    padding: var(--space-12) 0;
    border-top: 1px solid var(--border-subtle);
}

.feedback-roadmap-graph__phase,
.feedback-roadmap-graph__progress {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.feedback-roadmap-graph__phase strong,
.feedback-roadmap-graph__progress strong {
    color: var(--text-main);
    font-size: 14px;
}

.feedback-roadmap-graph__phase span,
.feedback-roadmap-graph__progress span {
    color: var(--text-muted);
    font-size: 11px;
}

.feedback-roadmap-graph__blocked {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--status-danger);
    font-size: 11px;
    font-weight: 700;
}

.feedback-roadmap-graph__progress {
    align-items: flex-end;
}

.feedback-roadmap-graph__track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--feedback-stage-count, 3), minmax(0, 1fr));
    gap: var(--space-8);
}

.feedback-roadmap-graph__track::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 12%;
    left: 12%;
    height: 2px;
    background: var(--border-subtle);
}

.feedback-roadmap-graph__progression {
    min-width: 0;
}

.feedback-roadmap-graph__progress-bar {
    height: 6px;
    margin: var(--space-10) 12% 0;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border-subtle);
}

.feedback-roadmap-graph__progress-fill {
    display: block;
    width: var(--feedback-progress-fill, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--feedback-progress-color, var(--text-brand));
    transition: width 220ms ease, background-color 220ms ease;
}

.feedback-roadmap-graph__stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    min-width: 0;
    color: var(--text-muted);
    text-align: center;
}

.feedback-roadmap-graph__stage-dot {
    width: 20px;
    height: 20px;
    border: 4px solid var(--bg-surface);
    border-radius: 50%;
    background: var(--border-subtle);
    box-shadow: 0 0 0 1px var(--border-subtle);
}

.feedback-roadmap-graph__stage.is-complete .feedback-roadmap-graph__stage-dot {
    background: var(--status-success);
    box-shadow: 0 0 0 1px var(--status-success);
}

.feedback-roadmap-graph__stage.is-populated .feedback-roadmap-graph__stage-dot {
    background: var(--feedback-stage-color, var(--text-brand));
    box-shadow: 0 0 0 1px var(--feedback-stage-color, var(--text-brand));
}

.feedback-roadmap-graph__stage.is-current .feedback-roadmap-graph__stage-dot {
    box-shadow: 0 0 0 1px var(--feedback-stage-color, var(--text-brand)), 0 0 0 5px color-mix(in srgb, var(--feedback-stage-color, var(--text-brand)) 18%, transparent);
}

.feedback-roadmap-graph__stage-label {
    overflow: hidden;
    max-width: 100%;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feedback-roadmap-graph__stage strong {
    color: var(--text-main);
    font-size: 12px;
}

.roadmap-phase-card__item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
}

.roadmap-phase-card__item-action {
    flex: 0 0 auto;
}

.roadmap-phase-card__empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.roadmap-phase-card__footer-label {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 12px;
}

.roadmap-phase-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-8);
    margin-left: auto;
}

.feedback-subphase-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

.feedback-subphase-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
    padding: var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg-overlay-l3) 40%, var(--bg-surface));
}

.feedback-subphase-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
}

.feedback-subphase-row__title {
    margin: 0;
    font-size: 0.875rem;
}

[data-theme="dark"] .roadmap-phase-card__item,
[data-theme="dark"] .feedback-subphase-row {
    background: color-mix(in srgb, var(--bg-overlay-l3) 55%, var(--bg-surface));
    border-color: var(--border-subtle);
}

@media (max-width: 640px) {
    .feedback-roadmap-graph__row {
        grid-template-columns: 1fr auto;
        gap: var(--space-10);
    }

    .feedback-roadmap-graph__progression {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .feedback-roadmap-graph__progress {
        grid-column: 2;
        grid-row: 1;
    }

    .analytics-card.roadmap-phase-card-shell .analytics-card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .roadmap-phase-card__actions {
        margin-left: 0;
        justify-content: stretch;
    }

    .roadmap-phase-card__actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/*
 * iOS Safari (and some Android WebViews) auto-zoom focused form controls when
 * computed font-size is below 16px. Force 16px on phones so focus stays stable.
 * Prefer this over maximum-scale=1 (keeps pinch-zoom accessible).
 */
@media (max-width: 899px) {
    input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="color"]),
    select,
    textarea,
    .ds-input,
    .ds-input input,
    .ds-select,
    .ds-textarea,
    .form-field__control > input,
    .form-field__control > select,
    .form-field__control > textarea,
    .searchable-select__search,
    .color-input-wrap input:not([type="color"]),
    .date-input-wrap input,
    .field-affix-wrap input,
    .field-affix-wrap select,
    .field-affix-wrap textarea,
    .input-icon-wrap input,
    .input-icon-wrap select,
    .input-icon-wrap textarea,
    .input-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
    .input-group select,
    .input-group textarea,
    .planning-excel-inline-select {
        font-size: 16px !important;
    }
}
