/*!
 * YH UI v1.3.0 — design system by Yousef F. Hekma
 * Extracted from RSM FleetDeck v1.6.0. Vanilla CSS, no build step, no external requests.
 *
 * How to use: add class="yh" to <html> (or <body>), load this file, done.
 * Theme: dark by default. Light: <html class="yh" data-yh-theme="light">. Follow the OS: data-yh-theme="auto".
 *   (Put data-yh-theme on <html>.)
 * Brand: override --yh-color-primary (+ -rgb, -hover, -on, -text) on :root or .yh.
 *
 * Sections
 *  1. Tokens: raw palette        9. Lists, tables
 *  2. Tokens: semantic (dark)   10. Badges, chips, avatars
 *  3. Tokens: light + auto      11. Notices, toasts, results
 *  4. Base                      12. Modal, confirm, menu, tooltip
 *  5. App shell & layout        13. Progress, spinner, skeleton, empty
 *  6. Page parts                14. Code, steps, pagination, misc
 *  7. Buttons                   15. Utilities
 *  8. Forms                     16. Responsive, motion, print
 *
 * Breakpoints (CSS variables can't be used in media queries, so they are fixed here):
 *   sm 640px · md 760px · lg 900px · xl 1100px
 *
 * Rules: never write inline styles, never invent colours — use the tokens below.
 * Licence of bundled icons (sprite / PHP): Lucide, ISC.
 */

/* =========================================================================
   1. TOKENS — RAW PALETTE (components never use these directly)
   ========================================================================= */
:root {
  --yh-ui-version: "1.3.0";

  --yh-gray-0: #ffffff;
  --yh-gray-50: #f8f8fa;
  --yh-gray-100: #f3f4f6;
  --yh-gray-150: #eceef1;
  --yh-gray-200: #e4e6ea;
  --yh-gray-300: #cfd3d9;
  --yh-gray-400: #8b8b8b;
  --yh-gray-500: #6b6f78;
  --yh-gray-600: #4b4f57;
  --yh-gray-700: #2a2a2a;
  --yh-gray-750: #252525;
  --yh-gray-800: #1e1e1e;
  --yh-gray-850: #141414;
  --yh-gray-900: #0f0f0f;
  --yh-gray-950: #0b0b0c;
  --yh-ink: #1d1e22;
  --yh-ink-chrome: #1b1a26;

  --yh-green-300: #a7d65e;
  --yh-green-500: #89C62B;
  --yh-green-600: #76ad25;
  --yh-green-700: #41690d;
  --yh-red-300: #ff8f8d;
  --yh-red-500: #E3413F;
  --yh-red-600: #cf2e2c;
  --yh-red-700: #b42318;
  --yh-amber-300: #f3c75a;
  --yh-amber-500: #e5a50a;
  --yh-amber-700: #8a5a00;
  --yh-blue-300: #7fcff2;
  --yh-blue-500: #2fa6da;
  --yh-blue-700: #0b6d99;
  --yh-teal-700: #0c6a95;
  --yh-ok-300: #8fdc84;
  --yh-ok-500: #3fae4a;
  --yh-ok-700: #1e7a2b;
}

/* =========================================================================
   2. TOKENS — SEMANTIC (dark = default theme)
   ========================================================================= */
:root {
  /* Brand (white-label: override these five) */
  --yh-color-primary: var(--yh-green-500);
  --yh-color-primary-rgb: 137, 198, 43;
  --yh-color-primary-hover: var(--yh-green-600);
  --yh-color-primary-on: #111111;          /* text on a primary fill */
  --yh-color-primary-text: var(--yh-green-500); /* primary used as text */

  /* Status */
  --yh-color-success: var(--yh-ok-500);
  --yh-color-warning: var(--yh-amber-500);
  --yh-color-danger: var(--yh-red-500);
  --yh-color-danger-strong: var(--yh-red-600);
  --yh-color-info: var(--yh-blue-500);
  --yh-success-bg: rgba(63, 174, 74, .14);   --yh-success-fg: var(--yh-ok-300);
  --yh-warning-bg: rgba(229, 165, 10, .14);  --yh-warning-fg: var(--yh-amber-300);
  --yh-danger-bg: rgba(227, 65, 63, .14);    --yh-danger-fg: var(--yh-red-300);
  --yh-info-bg: rgba(47, 166, 218, .14);     --yh-info-fg: var(--yh-blue-300);

  /* Surfaces */
  --yh-surface: var(--yh-gray-850);          /* page background */
  --yh-surface-raised: var(--yh-gray-800);   /* cards, inputs */
  --yh-surface-sunken: var(--yh-gray-750);   /* table heads, soft areas */
  --yh-surface-hover: var(--yh-gray-700);
  --yh-chrome: var(--yh-gray-950);           /* top bar */
  --yh-chrome-text: #ffffff;
  --yh-chrome-rail: var(--yh-gray-900);      /* side menus */
  --yh-backdrop: rgba(0, 0, 0, .55);

  /* Text & lines */
  --yh-text: #e8e8e8;
  --yh-text-muted: var(--yh-gray-400);
  --yh-text-link: var(--yh-blue-500);
  --yh-text-danger: var(--yh-red-300);
  --yh-border: rgba(255, 255, 255, .08);
  --yh-border-strong: rgba(255, 255, 255, .16);
  --yh-focus-ring: 0 0 0 3px rgba(var(--yh-color-primary-rgb), .25);

  /* Type */
  --yh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --yh-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --yh-text-xs: 12px;
  --yh-text-sm: 13px;
  --yh-text-md: 14px;   /* controls */
  --yh-text-lg: 15px;   /* body */
  --yh-text-xl: 17px;
  --yh-text-2xl: 20px;
  --yh-text-3xl: 26px;
  --yh-weight-regular: 400;
  --yh-weight-medium: 500;
  --yh-weight-semibold: 600;
  --yh-weight-bold: 700;
  --yh-leading-tight: 1.2;
  --yh-leading-normal: 1.5;

  /* Space (4px rhythm) */
  --yh-space-0: 0;
  --yh-space-1: 2px;
  --yh-space-2: 4px;
  --yh-space-3: 8px;
  --yh-space-4: 12px;
  --yh-space-5: 16px;
  --yh-space-6: 20px;
  --yh-space-7: 24px;
  --yh-space-8: 32px;
  --yh-space-9: 40px;
  --yh-space-10: 48px;

  /* Shape */
  --yh-radius-xs: 4px;
  --yh-radius-sm: 8px;
  --yh-radius-md: 12px;
  --yh-radius-lg: 16px;      /* white-label "corner style" overrides this */
  --yh-radius-pill: 999px;

  /* Depth */
  --yh-shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --yh-shadow-md: 0 8px 32px rgba(0, 0, 0, .35);
  --yh-shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
  --yh-shadow-overlay: 0 24px 60px rgba(0, 0, 0, .5);

  /* Controls (inputs, selects and buttons share these, so rows line up) */
  --yh-control-h-sm: 32px;
  --yh-control-h-md: 40px;
  --yh-control-h-lg: 46px;

  /* Motion */
  --yh-ease: ease;
  --yh-dur-fast: 120ms;
  --yh-dur-base: 160ms;
  --yh-dur-slow: 300ms;

  /* Layers */
  --yh-z-base: 0;
  --yh-z-raised: 5;
  --yh-z-rail: 25;
  --yh-z-sticky: 30;
  --yh-z-dropdown: 40;
  --yh-z-overlay: 50;
  --yh-z-toast: 60;
  --yh-z-tooltip: 70;

  /* Select arrow (an SVG data URI, tinted per theme) */
  --yh-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  --yh-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* =========================================================================
   3. TOKENS — LIGHT THEME (+ "auto" follows the device)
   ========================================================================= */
[data-yh-theme="light"],
html[data-theme="light"] {
  --yh-color-primary-text: var(--yh-green-700);
  --yh-success-bg: #e6f6e8;  --yh-success-fg: var(--yh-ok-700);
  --yh-warning-bg: #fdf3d8;  --yh-warning-fg: var(--yh-amber-700);
  --yh-danger-bg: #fde8e8;   --yh-danger-fg: var(--yh-red-700);
  --yh-info-bg: #e3f3fb;     --yh-info-fg: var(--yh-teal-700);
  --yh-surface: var(--yh-gray-100);
  --yh-surface-raised: var(--yh-gray-0);
  --yh-surface-sunken: #f5f6f8;
  --yh-surface-hover: #f0f1f4;
  --yh-chrome: var(--yh-ink-chrome);
  --yh-chrome-rail: var(--yh-gray-50);
  --yh-backdrop: rgba(17, 24, 39, .45);
  --yh-text: var(--yh-ink);
  --yh-text-muted: var(--yh-gray-500);
  --yh-text-link: var(--yh-blue-700);
  --yh-text-danger: #c62828;
  --yh-border: var(--yh-gray-200);
  --yh-border-strong: var(--yh-gray-300);
  --yh-shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --yh-shadow-md: 0 4px 20px rgba(17, 24, 39, .06);
  --yh-shadow-lg: 0 16px 40px rgba(17, 24, 39, .12);
  --yh-shadow-overlay: 0 24px 60px rgba(17, 24, 39, .25);
  --yh-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6f78' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  [data-yh-theme="auto"] {
    --yh-color-primary-text: var(--yh-green-700);
    --yh-success-bg: #e6f6e8;  --yh-success-fg: var(--yh-ok-700);
    --yh-warning-bg: #fdf3d8;  --yh-warning-fg: var(--yh-amber-700);
    --yh-danger-bg: #fde8e8;   --yh-danger-fg: var(--yh-red-700);
    --yh-info-bg: #e3f3fb;     --yh-info-fg: var(--yh-teal-700);
    --yh-surface: var(--yh-gray-100);
    --yh-surface-raised: var(--yh-gray-0);
    --yh-surface-sunken: #f5f6f8;
    --yh-surface-hover: #f0f1f4;
    --yh-chrome: var(--yh-ink-chrome);
    --yh-chrome-rail: var(--yh-gray-50);
    --yh-backdrop: rgba(17, 24, 39, .45);
    --yh-text: var(--yh-ink);
    --yh-text-muted: var(--yh-gray-500);
    --yh-text-link: var(--yh-blue-700);
    --yh-text-danger: #c62828;
    --yh-border: var(--yh-gray-200);
    --yh-border-strong: var(--yh-gray-300);
    --yh-shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
    --yh-shadow-md: 0 4px 20px rgba(17, 24, 39, .06);
    --yh-shadow-lg: 0 16px 40px rgba(17, 24, 39, .12);
    --yh-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6f78' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
    color-scheme: light;
  }
}

/* =========================================================================
   4. BASE (zero specificity via :where, so a tool's own CSS always wins)
   ========================================================================= */
:where(.yh), :where(.yh) *, :where(.yh) *::before, :where(.yh) *::after { box-sizing: border-box; }
:where(html.yh, .yh body), body.yh { margin: 0; background: var(--yh-surface); color: var(--yh-text); font: var(--yh-text-lg)/var(--yh-leading-normal) var(--yh-font); -webkit-font-smoothing: antialiased; }
:where(.yh) a { color: var(--yh-text-link); text-decoration: none; }
:where(.yh) a:hover { text-decoration: underline; }
:where(.yh) :focus-visible { outline: none; box-shadow: var(--yh-focus-ring); }
:where(.yh) h1, :where(.yh) .yh-h1 { font-size: var(--yh-text-3xl); font-weight: var(--yh-weight-bold); line-height: var(--yh-leading-tight); letter-spacing: -.01em; margin: 0; }
:where(.yh) h2, :where(.yh) .yh-h2 { font-size: var(--yh-text-xl); font-weight: var(--yh-weight-bold); line-height: var(--yh-leading-tight); margin: 0; }
:where(.yh) h3, :where(.yh) .yh-h3 { font-size: var(--yh-text-lg); font-weight: var(--yh-weight-bold); margin: 0 0 var(--yh-space-3); }
:where(.yh) p { margin: 0 0 var(--yh-space-4); }
:where(.yh) code, :where(.yh) kbd { font-family: var(--yh-font-mono); font-size: .86em; background: var(--yh-surface-sunken); border-radius: var(--yh-radius-xs); padding: 1px 6px; }
:where(.yh) hr { border: 0; border-top: 1px solid var(--yh-border); margin: var(--yh-space-6) 0; }
.yh-icon { width: 18px; height: 18px; flex: none; vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.yh-icon--sm { width: 14px; height: 14px; }
.yh-icon--lg { width: 22px; height: 22px; }

/* =========================================================================
   5. APP SHELL & LAYOUT
   ========================================================================= */
.yh-app { min-height: 100vh; background: var(--yh-chrome); }
.yh-app__top { position: sticky; top: 0; z-index: var(--yh-z-sticky); height: 64px; display: flex; align-items: center; gap: var(--yh-space-5); padding: 0 18px; background: var(--yh-chrome); color: var(--yh-chrome-text); }
.yh-app__brand { display: flex; align-items: center; gap: 10px; color: var(--yh-chrome-text); font-weight: var(--yh-weight-bold); font-size: var(--yh-text-lg); min-width: 0; }
.yh-app__brand:hover { text-decoration: none; }
.yh-app__mark { width: 34px; height: 34px; border-radius: 10px; background: var(--yh-color-primary); color: var(--yh-color-primary-on); display: grid; place-items: center; font-weight: var(--yh-weight-bold); flex: none; }
.yh-app__version { font-size: 11px; font-weight: var(--yh-weight-bold); opacity: .55; }
.yh-app__top-end { margin-left: auto; display: flex; align-items: center; gap: var(--yh-space-3); }
.yh-app__body { display: flex; min-height: calc(100vh - 72px); margin: 0 8px 8px; background: var(--yh-surface); border-radius: var(--yh-radius-lg); overflow: visible; overflow: clip; }
.yh-app__rail { width: 88px; flex: none; position: sticky; top: 64px; align-self: flex-start; height: calc(100vh - 72px); overflow-y: auto; display: flex; flex-direction: column; gap: var(--yh-space-2); padding: 12px 6px; background: var(--yh-chrome-rail); border-right: 1px solid var(--yh-border); }
.yh-app__rail a { display: flex; flex-direction: column; align-items: center; gap: var(--yh-space-2); padding: 8px 2px; border-radius: var(--yh-radius-md); color: var(--yh-text-muted); font-size: var(--yh-text-xs); font-weight: var(--yh-weight-bold); text-align: center; }
.yh-app__rail a:hover { color: var(--yh-text); text-decoration: none; }
.yh-app__rail .yh-app__rail-icon { width: 38px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.yh-app__rail a:hover .yh-app__rail-icon { background: var(--yh-surface-hover); }
.yh-app__rail a[aria-current] { color: var(--yh-text); }
.yh-app__rail a[aria-current] .yh-app__rail-icon { background: rgba(var(--yh-color-primary-rgb), .16); color: var(--yh-color-primary); }
.yh-app__subnav { width: 262px; flex: none; position: sticky; top: 64px; align-self: flex-start; height: calc(100vh - 72px); padding: 20px 14px; background: var(--yh-chrome-rail); border-right: 1px solid var(--yh-border); }
.yh-app__subnav-label { font-weight: var(--yh-weight-bold); font-size: var(--yh-text-md); margin: 0 4px var(--yh-space-3); }
.yh-app__subnav nav a { display: flex; align-items: center; gap: var(--yh-space-4); padding: 10px 12px; border-radius: 10px; color: var(--yh-text); font-weight: var(--yh-weight-semibold); font-size: var(--yh-text-md); margin-bottom: var(--yh-space-1); border: 1px solid transparent; }
.yh-app__subnav nav a:hover { background: var(--yh-surface-hover); text-decoration: none; }
.yh-app__subnav nav a .yh-icon { color: var(--yh-text-muted); }
.yh-app__subnav nav a[aria-current] { background: var(--yh-surface-raised); border-color: var(--yh-border); font-weight: var(--yh-weight-bold); box-shadow: var(--yh-shadow-sm); }
.yh-app__subnav nav a[aria-current] .yh-icon { color: var(--yh-color-primary); }
.yh-app__subnav nav a .yh-count { margin-left: auto; }
.yh-app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yh-app__content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 32px 32px; }
.yh-app__foot { text-align: center; color: var(--yh-text-muted); font-size: var(--yh-text-xs); padding: 0 16px 20px; }

.yh-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--yh-space-5); }
.yh-grid { display: grid; gap: var(--yh-space-5); }
.yh-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.yh-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.yh-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.yh-grid--auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.yh-stack { display: flex; flex-direction: column; gap: var(--yh-space-4); }
.yh-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--yh-space-3); }
.yh-split { display: flex; align-items: center; justify-content: space-between; gap: var(--yh-space-4); flex-wrap: wrap; }

/* =========================================================================
   6. PAGE PARTS: header, breadcrumbs, tabs, toolbar, segmented
   ========================================================================= */
.yh-page-header { display: flex; justify-content: space-between; align-items: center; gap: var(--yh-space-4); flex-wrap: wrap; margin-bottom: var(--yh-space-6); }
.yh-page-header__sub { color: var(--yh-text-muted); margin-top: var(--yh-space-2); font-size: var(--yh-text-lg); }
.yh-page-header__actions { display: flex; gap: var(--yh-space-3); flex-wrap: wrap; align-items: center; }
.yh-breadcrumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--yh-text-md); color: var(--yh-text-muted); margin-bottom: 10px; padding: 0; list-style: none; }
.yh-breadcrumbs a { color: var(--yh-text-muted); }
.yh-breadcrumbs [aria-current] { color: var(--yh-text); font-weight: var(--yh-weight-bold); }
.yh-tabs { display: flex; gap: var(--yh-space-2); border-bottom: 1px solid var(--yh-border); margin-bottom: var(--yh-space-6); overflow-x: auto; }
.yh-tabs__tab { display: inline-flex; align-items: center; gap: var(--yh-space-3); padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--yh-text-muted); font: inherit; font-size: var(--yh-text-md); font-weight: var(--yh-weight-semibold); cursor: pointer; white-space: nowrap; }
.yh-tabs__tab:hover, .yh-tabs__tab.is-hover { color: var(--yh-text); text-decoration: none; }
.yh-tabs__tab[aria-selected="true"], .yh-tabs__tab[aria-current] { color: var(--yh-text); border-bottom-color: var(--yh-color-primary); font-weight: var(--yh-weight-bold); }
.yh-tabs__panel[hidden] { display: none; }
.yh-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.yh-toolbar .yh-input { max-width: 320px; }
.yh-segmented { display: inline-flex; gap: var(--yh-space-1); padding: 3px; border-radius: var(--yh-radius-pill); background: var(--yh-surface-sunken); border: 1px solid var(--yh-border); flex-wrap: wrap; }
.yh-segmented__item { border: 0; background: transparent; height: calc(var(--yh-control-h-sm) - 2px); padding: 0 13px; font: inherit; font-size: var(--yh-text-sm); font-weight: var(--yh-weight-semibold); color: var(--yh-text-muted); border-radius: var(--yh-radius-pill); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.yh-segmented__item:hover { color: var(--yh-text); }
.yh-segmented__item[aria-pressed="true"] { background: var(--yh-surface-raised); color: var(--yh-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }

/* =========================================================================
   7. BUTTONS
   ========================================================================= */
.yh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--yh-control-h-md); padding: 0 16px; border-radius: var(--yh-radius-pill); border: 1px solid var(--yh-border-strong); background: var(--yh-surface-raised); color: var(--yh-text); font: inherit; font-size: var(--yh-text-md); font-weight: var(--yh-weight-bold); line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color var(--yh-dur-base) var(--yh-ease), border-color var(--yh-dur-base) var(--yh-ease), color var(--yh-dur-base) var(--yh-ease), box-shadow var(--yh-dur-base) var(--yh-ease); }
.yh-btn:hover, .yh-btn.is-hover { border-color: var(--yh-color-primary); text-decoration: none; }
.yh-btn:focus-visible, .yh-btn.is-focus { outline: none; box-shadow: var(--yh-focus-ring); }
.yh-btn:active, .yh-btn.is-active { transform: translateY(1px); }
.yh-btn--primary { background: var(--yh-color-primary); border-color: var(--yh-color-primary); color: var(--yh-color-primary-on); }
.yh-btn--primary:hover, .yh-btn--primary.is-hover { background: var(--yh-color-primary-hover); border-color: var(--yh-color-primary-hover); }
.yh-btn--secondary { background: var(--yh-surface-raised); }
.yh-btn--ghost { background: transparent; border-color: transparent; color: var(--yh-text); }
.yh-btn--ghost:hover, .yh-btn--ghost.is-hover { background: var(--yh-surface-hover); border-color: transparent; }
.yh-btn--danger { background: transparent; color: var(--yh-text-danger); border-color: rgba(227, 65, 63, .5); }
.yh-btn--danger:hover, .yh-btn--danger.is-hover { background: var(--yh-color-danger-strong); border-color: var(--yh-color-danger-strong); color: #ffffff; }
.yh-btn--danger-solid { background: var(--yh-color-danger-strong); border-color: var(--yh-color-danger-strong); color: #ffffff; }
.yh-btn--link { height: auto; padding: 0; border: 0; background: none; color: var(--yh-text-link); font-weight: var(--yh-weight-semibold); }
.yh-btn--link:hover, .yh-btn--link.is-hover { text-decoration: underline; border: 0; }
.yh-btn--on-dark { background: transparent; color: var(--yh-chrome-text); border-color: rgba(255, 255, 255, .16); }
.yh-btn--on-dark:hover, .yh-btn--on-dark.is-hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.yh-btn--sm { height: var(--yh-control-h-sm); padding: 0 12px; font-size: var(--yh-text-sm); }
.yh-btn--lg { height: var(--yh-control-h-lg); padding: 0 22px; font-size: var(--yh-text-lg); }
.yh-btn--icon { width: var(--yh-control-h-md); padding: 0; }
.yh-btn--icon.yh-btn--sm { width: var(--yh-control-h-sm); }
.yh-btn--icon.yh-btn--lg { width: var(--yh-control-h-lg); }
.yh-btn--block { display: flex; width: 100%; }
.yh-btn[disabled], .yh-btn.is-disabled, .yh-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.yh-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.yh-btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--yh-text-muted) transparent var(--yh-text-muted) transparent; animation: yh-spin .8s linear infinite; }
.yh-btn--primary.is-loading::after { border-color: var(--yh-color-primary-on) transparent var(--yh-color-primary-on) transparent; }
.yh-btn-group { display: inline-flex; gap: var(--yh-space-3); flex-wrap: wrap; align-items: center; }

/* =========================================================================
   8. FORMS
   ========================================================================= */
/* Field wrapper: label + control + help/error */
.yh-field { margin-bottom: var(--yh-space-5); min-width: 0; }
.yh-field__label { display: block; font-weight: var(--yh-weight-bold); font-size: var(--yh-text-md); margin: 0 0 6px; }
.yh-field__req { color: var(--yh-text-danger); margin-left: 2px; }
.yh-field__opt { color: var(--yh-text-muted); font-weight: var(--yh-weight-medium); font-size: var(--yh-text-xs); margin-left: 4px; }
.yh-field__help { color: var(--yh-text-muted); font-size: var(--yh-text-sm); margin: 6px 0 0; }
.yh-field__error { color: var(--yh-text-danger); font-size: var(--yh-text-sm); font-weight: var(--yh-weight-semibold); margin: 6px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.yh-field--inline { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--yh-space-5); align-items: start; }
.yh-field--inline .yh-field__label { margin-top: 10px; }

/* Text-like controls */
.yh-input, .yh-select, .yh-textarea { display: block; width: 100%; height: var(--yh-control-h-md); padding: 0 13px; border: 1px solid var(--yh-border-strong); border-radius: var(--yh-radius-md); background: var(--yh-surface-raised); color: var(--yh-text); font: inherit; font-size: var(--yh-text-md); transition: border-color var(--yh-dur-base) var(--yh-ease), box-shadow var(--yh-dur-base) var(--yh-ease), background-color var(--yh-dur-base) var(--yh-ease); }
.yh-textarea { height: auto; min-height: 96px; padding: 10px 13px; resize: vertical; line-height: var(--yh-leading-normal); }
.yh-input::placeholder, .yh-textarea::placeholder { color: var(--yh-text-muted); opacity: .8; }
.yh-input:hover, .yh-select:hover, .yh-textarea:hover, .yh-input.is-hover, .yh-select.is-hover { border-color: rgba(var(--yh-color-primary-rgb), .55); }
.yh-input:focus, .yh-select:focus, .yh-textarea:focus, .yh-input.is-focus, .yh-select.is-focus, .yh-textarea.is-focus { outline: none; border-color: var(--yh-color-primary); box-shadow: var(--yh-focus-ring); }
.yh-input[disabled], .yh-select[disabled], .yh-textarea[disabled] { opacity: .55; cursor: not-allowed; }
.yh-input[readonly], .yh-textarea[readonly] { background: var(--yh-surface-sunken); border-style: dashed; }
.yh-input--sm, .yh-select--sm { height: var(--yh-control-h-sm); font-size: var(--yh-text-sm); padding: 0 10px; }
.yh-input--lg, .yh-select--lg { height: var(--yh-control-h-lg); font-size: var(--yh-text-lg); }
.yh-input--mono, .yh-textarea--mono { font-family: var(--yh-font-mono); font-size: var(--yh-text-sm); }
.yh-input--pill, .yh-select--pill { border-radius: var(--yh-radius-pill); }
.is-invalid, .yh-field--error .yh-input, .yh-field--error .yh-select, .yh-field--error .yh-textarea { border-color: var(--yh-color-danger) !important; }
.yh-field--error .yh-input:focus, .yh-field--error .yh-textarea:focus { box-shadow: 0 0 0 3px rgba(227, 65, 63, .22); }
.is-valid, .yh-field--success .yh-input, .yh-field--success .yh-select, .yh-field--success .yh-textarea { border-color: var(--yh-color-success) !important; }

/* Native select with a custom arrow (accessible, mobile-friendly) */
.yh-select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 40px; cursor: pointer; background-image: var(--yh-chevron); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px; text-overflow: ellipsis; }
.yh-select::-ms-expand { display: none; }
.yh-select[multiple], .yh-select[size] { height: auto; min-height: 120px; padding: 6px; background-image: none; }
.yh-select[multiple] option { padding: 6px 8px; border-radius: 6px; }
.yh-select option, .yh-select optgroup { background: var(--yh-surface-raised); color: var(--yh-text); }

/* Input group: prefix/suffix text, icon or button */
.yh-input-group { display: flex; align-items: stretch; width: 100%; }
.yh-input-group > .yh-input { flex: 1; min-width: 0; border-radius: 0; }
.yh-input-group > :first-child { border-top-left-radius: var(--yh-radius-md); border-bottom-left-radius: var(--yh-radius-md); }
.yh-input-group > :last-child { border-top-right-radius: var(--yh-radius-md); border-bottom-right-radius: var(--yh-radius-md); }
.yh-input-group__addon { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: var(--yh-control-h-md); border: 1px solid var(--yh-border-strong); background: var(--yh-surface-sunken); color: var(--yh-text-muted); font-size: var(--yh-text-sm); white-space: nowrap; }
.yh-input-group__addon:first-child { border-right: 0; }
.yh-input-group__addon:last-child { border-left: 0; }
.yh-input-group > .yh-btn { border-radius: 0; height: var(--yh-control-h-md); }
.yh-input-group > .yh-btn:last-child { margin-left: -1px; }
.yh-input-icon { position: relative; }
.yh-input-icon > .yh-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--yh-text-muted); pointer-events: none; }
.yh-input-icon > .yh-input { padding-left: 38px; }

/* Checkbox & radio (native input, custom look) */
.yh-check, .yh-radio { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-items: start; margin: var(--yh-space-3) 0; cursor: pointer; font-weight: var(--yh-weight-semibold); font-size: var(--yh-text-md); }
.yh-check input, .yh-radio input { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1.5px solid var(--yh-border-strong); background: var(--yh-surface-raised); display: grid; place-items: center; cursor: pointer; transition: background-color var(--yh-dur-fast) var(--yh-ease), border-color var(--yh-dur-fast) var(--yh-ease); }
.yh-check input { border-radius: 5px; }
.yh-radio input { border-radius: 50%; }
.yh-check input:checked { background: var(--yh-color-primary) var(--yh-check) center / 13px no-repeat; border-color: var(--yh-color-primary); }
.yh-radio input:checked { border-color: var(--yh-color-primary); background: radial-gradient(circle, var(--yh-color-primary) 0 4px, var(--yh-surface-raised) 5px); }
.yh-check input:indeterminate { background: var(--yh-color-primary); border-color: var(--yh-color-primary); box-shadow: inset 0 0 0 4px var(--yh-color-primary), inset 0 0 0 9px var(--yh-color-primary-on); }
.yh-check input:hover, .yh-radio input:hover { border-color: var(--yh-color-primary); }
.yh-check input:focus-visible, .yh-radio input:focus-visible { outline: none; box-shadow: var(--yh-focus-ring); }
.yh-check input:disabled, .yh-radio input:disabled { opacity: .5; cursor: not-allowed; }
.yh-check:has(input:disabled), .yh-radio:has(input:disabled) { cursor: not-allowed; color: var(--yh-text-muted); }
.yh-check__hint, .yh-radio__hint { grid-column: 2; display: block; color: var(--yh-text-muted); font-weight: var(--yh-weight-medium); font-size: var(--yh-text-sm); }

/* Toggle switch (a checkbox, so it works without JS) */
.yh-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: var(--yh-weight-semibold); font-size: var(--yh-text-md); }
.yh-switch input { -webkit-appearance: none; appearance: none; position: relative; width: 40px; height: 24px; margin: 0; flex: none; border-radius: var(--yh-radius-pill); background: var(--yh-border-strong); cursor: pointer; transition: background-color var(--yh-dur-base) var(--yh-ease); }
.yh-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform var(--yh-dur-base) var(--yh-ease); }
.yh-switch input:checked { background: var(--yh-color-primary); }
.yh-switch input:checked::after { transform: translateX(16px); }
.yh-switch input:focus-visible { outline: none; box-shadow: var(--yh-focus-ring); }
.yh-switch input:disabled { opacity: .5; cursor: not-allowed; }
.yh-switch--sm input { width: 32px; height: 20px; }
.yh-switch--sm input::after { width: 14px; height: 14px; }
.yh-switch--sm input:checked::after { transform: translateX(12px); }

/* File input & dropzone */
.yh-file { font: inherit; font-size: var(--yh-text-sm); color: var(--yh-text-muted); }
.yh-file::file-selector-button { font: inherit; font-weight: var(--yh-weight-bold); font-size: var(--yh-text-sm); height: var(--yh-control-h-sm); padding: 0 12px; margin-right: 10px; border-radius: var(--yh-radius-pill); border: 1px solid var(--yh-border-strong); background: var(--yh-surface-sunken); color: var(--yh-text); cursor: pointer; }
.yh-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--yh-space-2); min-height: 160px; padding: var(--yh-space-6); text-align: center; border: 2px dashed var(--yh-border-strong); border-radius: var(--yh-radius-md); cursor: pointer; transition: border-color var(--yh-dur-base) var(--yh-ease), background-color var(--yh-dur-base) var(--yh-ease); }
.yh-dropzone:hover, .yh-dropzone.is-hover { border-color: var(--yh-color-primary); background: rgba(var(--yh-color-primary-rgb), .04); }
.yh-dropzone.is-dragover { border-style: solid; border-color: var(--yh-color-info); background: var(--yh-info-bg); }
.yh-dropzone[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.yh-dropzone__icon { color: var(--yh-color-primary); }
.yh-dropzone__title { font-size: var(--yh-text-lg); font-weight: var(--yh-weight-semibold); color: var(--yh-text-muted); }
.yh-dropzone__title b { color: var(--yh-text-link); }
.yh-dropzone__hint { font-size: var(--yh-text-xs); color: var(--yh-text-muted); }

/* Searchable dropdown (combobox) — <details> + a search box + links/options */
.yh-combobox { position: relative; }
.yh-combobox > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: var(--yh-control-h-md); padding: 6px 10px 6px 12px; border: 1px solid var(--yh-border-strong); border-radius: var(--yh-radius-md); background: var(--yh-surface-raised); cursor: pointer; }
.yh-combobox > summary::-webkit-details-marker { display: none; }
.yh-combobox > summary:hover { border-color: rgba(var(--yh-color-primary-rgb), .55); }
.yh-combobox[open] > summary, .yh-combobox > summary:focus-visible { outline: none; border-color: var(--yh-color-primary); box-shadow: var(--yh-focus-ring); }
.yh-combobox__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yh-combobox__value small { display: block; color: var(--yh-text-muted); font-size: var(--yh-text-xs); }
.yh-combobox__pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: var(--yh-z-dropdown); background: var(--yh-surface-raised); border: 1px solid var(--yh-border-strong); border-radius: var(--yh-radius-md); box-shadow: var(--yh-shadow-lg); padding: 6px; max-height: min(420px, 60vh); display: flex; flex-direction: column; animation: yh-pop var(--yh-dur-fast) ease-out; }
.yh-combobox__search { margin: 2px 2px 6px; }
.yh-combobox__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.yh-combobox__group { font-size: 11px; font-weight: var(--yh-weight-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--yh-text-muted); padding: 8px 8px 4px; }
.yh-combobox__option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--yh-radius-sm); background: none; color: var(--yh-text); font: inherit; font-size: var(--yh-text-md); text-align: left; cursor: pointer; }
.yh-combobox__option:hover, .yh-combobox__option:focus-visible { background: var(--yh-surface-hover); outline: none; text-decoration: none; }
.yh-combobox__option[aria-selected="true"], .yh-combobox__option[aria-current] { background: rgba(var(--yh-color-primary-rgb), .13); font-weight: var(--yh-weight-bold); }
.yh-combobox__empty { padding: 12px 10px; color: var(--yh-text-muted); font-size: var(--yh-text-sm); }

/* Form layout */
.yh-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--yh-space-5); }
.yh-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.yh-form-actions { display: flex; gap: var(--yh-space-3); flex-wrap: wrap; align-items: center; margin-top: var(--yh-space-5); }
.yh-fieldset { border: 1px solid var(--yh-border); border-radius: var(--yh-radius-md); padding: var(--yh-space-4) var(--yh-space-5); margin: 0 0 var(--yh-space-5); }
.yh-fieldset legend { font-weight: var(--yh-weight-bold); padding: 0 6px; }
.yh-color { width: 64px; height: var(--yh-control-h-md); padding: 3px; border: 1px solid var(--yh-border-strong); border-radius: var(--yh-radius-sm); background: var(--yh-surface-raised); cursor: pointer; }

/* =========================================================================
   9. CARDS, STATS, KEY-VALUE, LISTS, TABLES
   ========================================================================= */
.yh-card { background: var(--yh-surface-raised); border: 1px solid var(--yh-border); border-radius: var(--yh-radius-lg); box-shadow: var(--yh-shadow-md); margin-bottom: var(--yh-space-5); min-width: 0; }
.yh-grid > .yh-card { margin-bottom: 0; }
.yh-card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--yh-space-4); flex-wrap: wrap; padding: 16px 22px 0; }
.yh-card__header:last-child { padding-bottom: 16px; }
.yh-card__title { font-size: var(--yh-text-xl); font-weight: var(--yh-weight-bold); margin: 0; display: flex; align-items: center; gap: var(--yh-space-3); }
.yh-card__sub { color: var(--yh-text-muted); font-size: var(--yh-text-sm); }
.yh-card__body { padding: 16px 22px 20px; }
.yh-card__footer { padding: 14px 22px; border-top: 1px solid var(--yh-border); display: flex; gap: var(--yh-space-3); justify-content: flex-end; flex-wrap: wrap; }
.yh-card--flat { box-shadow: none; }
.yh-card--interactive { transition: border-color var(--yh-dur-base) var(--yh-ease); }
.yh-card--interactive:hover { border-color: var(--yh-border-strong); }

.yh-stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--yh-surface-raised); border: 1px solid var(--yh-border); border-radius: var(--yh-radius-lg); box-shadow: var(--yh-shadow-md); color: var(--yh-text); }
a.yh-stat:hover { border-color: var(--yh-border-strong); text-decoration: none; }
.yh-stat__icon { width: 44px; height: 44px; border-radius: var(--yh-radius-md); display: grid; place-items: center; background: var(--yh-surface-sunken); color: var(--yh-text-muted); flex: none; }
.yh-stat__value { display: block; font-size: var(--yh-text-3xl); font-weight: var(--yh-weight-bold); line-height: 1.1; }
.yh-stat__label { color: var(--yh-text-muted); font-size: var(--yh-text-sm); font-weight: var(--yh-weight-semibold); }
.yh-stat--success .yh-stat__icon { background: var(--yh-success-bg); color: var(--yh-success-fg); }
.yh-stat--warning .yh-stat__icon { background: var(--yh-warning-bg); color: var(--yh-warning-fg); }
.yh-stat--danger .yh-stat__icon { background: var(--yh-danger-bg); color: var(--yh-danger-fg); }
.yh-stat--info .yh-stat__icon { background: var(--yh-info-bg); color: var(--yh-info-fg); }

.yh-kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; margin: 0; }
.yh-kv dt, .yh-kv dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--yh-border); }
.yh-kv dt { color: var(--yh-text-muted); font-size: var(--yh-text-md); }
.yh-kv dd { font-weight: var(--yh-weight-semibold); word-break: break-word; }
.yh-kv dt:first-of-type, .yh-kv dt:first-of-type + dd { border-top: 0; }

.yh-list { list-style: none; margin: 0; padding: 0; }
.yh-list__item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--yh-border); }
.yh-list__item:first-child { border-top: 0; }
.yh-list__item:hover { background: var(--yh-surface-hover); }
.yh-list__media { flex: none; }
.yh-list__body { flex: 1; min-width: 0; }
.yh-list__title { font-weight: var(--yh-weight-bold); display: flex; align-items: center; gap: var(--yh-space-3); flex-wrap: wrap; }
.yh-list__meta { color: var(--yh-text-muted); font-size: var(--yh-text-sm); margin-top: 2px; }
.yh-list__actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.yh-list--compact .yh-list__item { padding: 10px 18px; }
.yh-list--flush .yh-list__item { padding-left: 0; padding-right: 0; }
.yh-list--static .yh-list__item:hover { background: none; }

.yh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.yh-table { width: 100%; border-collapse: collapse; font-size: var(--yh-text-md); }
.yh-table th { text-align: left; font-size: var(--yh-text-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--yh-text-muted); font-weight: var(--yh-weight-bold); padding: 11px 16px; background: var(--yh-surface-sunken); white-space: nowrap; }
.yh-table td { padding: 12px 16px; border-top: 1px solid var(--yh-border); vertical-align: middle; }
.yh-table--striped tbody tr:nth-child(even) td { background: rgba(127, 127, 127, .04); }
.yh-table--hover tbody tr:hover td { background: var(--yh-surface-hover); }
.yh-table--compact th, .yh-table--compact td { padding: 7px 12px; }
.yh-table__num { text-align: right; font-variant-numeric: tabular-nums; }
.yh-table__actions { text-align: right; white-space: nowrap; }
.yh-table tbody tr.is-selected td { background: rgba(var(--yh-color-primary-rgb), .1); }
.yh-table tbody tr.is-danger td { background: var(--yh-danger-bg); }

/* =========================================================================
   10. BADGES, CHIPS, COUNTS, DOTS, AVATARS
   ========================================================================= */
.yh-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--yh-radius-pill); border: 1px solid var(--yh-border); background: var(--yh-surface-raised); color: var(--yh-text-muted); font-size: var(--yh-text-xs); font-weight: var(--yh-weight-bold); line-height: 1.5; white-space: nowrap; }
.yh-badge--success { background: var(--yh-success-bg); color: var(--yh-success-fg); border-color: transparent; }
.yh-badge--warning { background: var(--yh-warning-bg); color: var(--yh-warning-fg); border-color: transparent; }
.yh-badge--danger { background: var(--yh-danger-bg); color: var(--yh-danger-fg); border-color: transparent; }
.yh-badge--info { background: var(--yh-info-bg); color: var(--yh-info-fg); border-color: transparent; }
.yh-badge--primary { background: rgba(var(--yh-color-primary-rgb), .14); color: var(--yh-color-primary-text); border-color: transparent; }
.yh-badge--group { color: var(--yh-text); background: color-mix(in srgb, var(--yh-group, #64748b) 16%, transparent); border-color: color-mix(in srgb, var(--yh-group, #64748b) 35%, transparent); }
.yh-badge--sm { padding: 1px 7px; }
a.yh-badge:hover { text-decoration: none; filter: brightness(1.06); }
.yh-chip { display: inline-flex; align-items: center; gap: 7px; height: var(--yh-control-h-sm); padding: 0 14px; border-radius: var(--yh-radius-pill); border: 1px solid var(--yh-border); background: var(--yh-surface-raised); color: var(--yh-text); font: inherit; font-size: var(--yh-text-sm); font-weight: var(--yh-weight-bold); cursor: pointer; }
.yh-chip:hover { border-color: var(--yh-border-strong); text-decoration: none; }
.yh-chip[aria-pressed="true"], .yh-chip.is-active { border-color: var(--yh-color-primary); background: rgba(var(--yh-color-primary-rgb), .12); }
.yh-chip__count { color: var(--yh-text-muted); }
.yh-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--yh-radius-pill); background: var(--yh-color-primary); color: var(--yh-color-primary-on); font-size: 11px; font-weight: var(--yh-weight-bold); line-height: 1; }
.yh-count--warning { background: var(--yh-color-warning); color: #1d1300; }
.yh-count--danger { background: var(--yh-color-danger-strong); color: #ffffff; }
.yh-count--muted { background: var(--yh-surface-sunken); color: var(--yh-text-muted); }
.yh-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.yh-dot--success { background: var(--yh-color-success); }
.yh-dot--warning { background: var(--yh-color-warning); }
.yh-dot--danger { background: var(--yh-color-danger); }
.yh-dot--muted { background: var(--yh-border-strong); }
.yh-dot--pulse { box-shadow: 0 0 0 0 currentColor; animation: yh-pulse 2s infinite; }
.yh-avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--yh-radius-md); background: var(--yh-group, var(--yh-gray-600)); color: #ffffff; font-weight: var(--yh-weight-bold); font-size: 18px; overflow: hidden; }
.yh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.yh-avatar--sm { width: 34px; height: 34px; border-radius: 10px; font-size: var(--yh-text-md); }
.yh-avatar--xs { width: 26px; height: 26px; border-radius: var(--yh-radius-sm); font-size: var(--yh-text-xs); }
.yh-avatar--lg { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.yh-avatar--round { border-radius: 50%; }

/* =========================================================================
   11. NOTICES, TOASTS, INLINE RESULTS
   ========================================================================= */
.yh-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--yh-radius-md); margin-bottom: var(--yh-space-5); font-size: var(--yh-text-md); font-weight: var(--yh-weight-semibold); background: var(--yh-surface-sunken); color: var(--yh-text); }
.yh-notice > .yh-icon { margin-top: 1px; }
.yh-notice__body { flex: 1; min-width: 0; }
.yh-notice__title { display: block; font-weight: var(--yh-weight-bold); margin-bottom: 2px; }
.yh-notice__actions { display: flex; gap: var(--yh-space-3); flex-wrap: wrap; align-self: center; }
.yh-notice a { color: inherit; text-decoration: underline; }
.yh-notice .yh-btn { text-decoration: none; }
.yh-notice--info { background: var(--yh-info-bg); color: var(--yh-info-fg); }
.yh-notice--success { background: var(--yh-success-bg); color: var(--yh-success-fg); }
.yh-notice--warning { background: var(--yh-warning-bg); color: var(--yh-warning-fg); }
.yh-notice--danger { background: var(--yh-danger-bg); color: var(--yh-danger-fg); }
.yh-notice__close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 2px; border-radius: var(--yh-radius-xs); }
.yh-notice__close:hover { opacity: 1; }

.yh-toasts { position: fixed; right: 16px; bottom: 16px; z-index: var(--yh-z-toast); display: flex; flex-direction: column; gap: var(--yh-space-3); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.yh-toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--yh-radius-md); background: var(--yh-surface-raised); color: var(--yh-text); border: 1px solid var(--yh-border-strong); border-left: 4px solid var(--yh-color-info); box-shadow: var(--yh-shadow-lg); font-size: var(--yh-text-md); font-weight: var(--yh-weight-semibold); animation: yh-toast-in var(--yh-dur-slow) var(--yh-ease); }
.yh-toast--success { border-left-color: var(--yh-color-success); }
.yh-toast--warning { border-left-color: var(--yh-color-warning); }
.yh-toast--danger { border-left-color: var(--yh-color-danger); }
.yh-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--yh-dur-base), transform var(--yh-dur-base); }

.yh-result { margin-top: 6px; font-size: var(--yh-text-sm); font-weight: var(--yh-weight-semibold); }
.yh-result--success { color: var(--yh-success-fg); }
.yh-result--warning { color: var(--yh-warning-fg); }
.yh-result--danger { color: var(--yh-danger-fg); }

/* =========================================================================
   12. MODAL, CONFIRM, MENU, TOOLTIP
   ========================================================================= */
.yh-modal { border: 1px solid var(--yh-border); border-radius: var(--yh-radius-lg); background: var(--yh-surface-raised); color: var(--yh-text); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--yh-shadow-overlay); }
.yh-modal::backdrop { background: var(--yh-backdrop); }
.yh-modal[open] { animation: yh-pop var(--yh-dur-base) ease-out; }
.yh-modal--sm { width: min(420px, calc(100vw - 32px)); }
.yh-modal--lg { width: min(820px, calc(100vw - 32px)); }
.yh-modal__header { display: flex; align-items: center; justify-content: space-between; gap: var(--yh-space-4); padding: 18px 22px 6px; }
.yh-modal__title { font-size: var(--yh-text-xl); font-weight: var(--yh-weight-bold); margin: 0; }
.yh-modal__body { padding: 8px 22px 6px; max-height: 60vh; overflow-y: auto; }
.yh-modal__footer { display: flex; gap: var(--yh-space-3); justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px 18px; }
.yh-confirm__icon { width: 44px; height: 44px; border-radius: var(--yh-radius-md); display: grid; place-items: center; background: var(--yh-warning-bg); color: var(--yh-warning-fg); margin-bottom: var(--yh-space-4); }
.yh-confirm--danger .yh-confirm__icon { background: var(--yh-danger-bg); color: var(--yh-danger-fg); }

.yh-menu { position: relative; display: inline-block; }
.yh-menu__list { position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--yh-z-dropdown); min-width: 210px; padding: 6px; background: var(--yh-surface-raised); color: var(--yh-text); border: 1px solid var(--yh-border); border-radius: var(--yh-radius-md); box-shadow: var(--yh-shadow-lg); animation: yh-pop var(--yh-dur-fast) ease-out; }
.yh-menu__list[hidden] { display: none; }
.yh-menu--left .yh-menu__list { left: 0; right: auto; }
.yh-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--yh-radius-sm); background: none; color: var(--yh-text); font: inherit; font-size: var(--yh-text-md); text-align: left; cursor: pointer; }
.yh-menu__item:hover, .yh-menu__item:focus-visible { background: var(--yh-surface-hover); text-decoration: none; outline: none; }
.yh-menu__item--danger { color: var(--yh-text-danger); }
.yh-menu__sep { height: 1px; background: var(--yh-border); margin: 6px 4px; }
.yh-menu__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--yh-border); margin-bottom: 4px; }

[data-yh-tip] { position: relative; }
[data-yh-tip]::after { content: attr(data-yh-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px); z-index: var(--yh-z-tooltip); background: var(--yh-text); color: var(--yh-surface-raised); font-size: var(--yh-text-xs); font-weight: var(--yh-weight-semibold); line-height: 1.3; white-space: nowrap; padding: 5px 8px; border-radius: 6px; box-shadow: var(--yh-shadow-md); pointer-events: none; opacity: 0; transition: opacity var(--yh-dur-fast) var(--yh-ease), transform var(--yh-dur-fast) var(--yh-ease); }
[data-yh-tip]:hover::after, [data-yh-tip]:focus-visible::after, [data-yh-tip].is-hover::after { opacity: 1; transform: translate(-50%, 0); }
[data-yh-tip-pos="bottom"]::after { bottom: auto; top: calc(100% + 6px); }

/* =========================================================================
   13. PROGRESS, SPINNER, SKELETON, EMPTY STATE
   ========================================================================= */
.yh-progress { --yh-progress: 0%; width: 100%; height: 8px; border-radius: var(--yh-radius-pill); background: var(--yh-surface-sunken); overflow: hidden; }
.yh-progress__bar { display: block; height: 100%; width: var(--yh-progress); border-radius: inherit; background: var(--yh-color-primary); transition: width var(--yh-dur-slow) var(--yh-ease); }
.yh-progress--sm { height: 4px; }
.yh-progress--lg { height: 12px; }
.yh-progress--success .yh-progress__bar { background: var(--yh-color-success); }
.yh-progress--warning .yh-progress__bar { background: var(--yh-color-warning); }
.yh-progress--danger .yh-progress__bar { background: var(--yh-color-danger); }
.yh-progress--indeterminate .yh-progress__bar { width: 35%; animation: yh-indeterminate 1.2s ease-in-out infinite; }
/* Server-rendered progress without inline styles: data-yh-value="0..100" in steps of 5 (JS YH.progress() sets any value). */
.yh-progress[data-yh-value="0"]{--yh-progress:0%;} .yh-progress[data-yh-value="5"]{--yh-progress:5%;} .yh-progress[data-yh-value="10"]{--yh-progress:10%;} .yh-progress[data-yh-value="15"]{--yh-progress:15%;} .yh-progress[data-yh-value="20"]{--yh-progress:20%;}
 .yh-progress[data-yh-value="25"]{--yh-progress:25%;} .yh-progress[data-yh-value="30"]{--yh-progress:30%;} .yh-progress[data-yh-value="35"]{--yh-progress:35%;} .yh-progress[data-yh-value="40"]{--yh-progress:40%;} .yh-progress[data-yh-value="45"]{--yh-progress:45%;}
 .yh-progress[data-yh-value="50"]{--yh-progress:50%;} .yh-progress[data-yh-value="55"]{--yh-progress:55%;} .yh-progress[data-yh-value="60"]{--yh-progress:60%;} .yh-progress[data-yh-value="65"]{--yh-progress:65%;} .yh-progress[data-yh-value="70"]{--yh-progress:70%;}
 .yh-progress[data-yh-value="75"]{--yh-progress:75%;} .yh-progress[data-yh-value="80"]{--yh-progress:80%;} .yh-progress[data-yh-value="85"]{--yh-progress:85%;} .yh-progress[data-yh-value="90"]{--yh-progress:90%;} .yh-progress[data-yh-value="95"]{--yh-progress:95%;}
 .yh-progress[data-yh-value="100"]{--yh-progress:100%;}
.yh-progress-label { display: flex; justify-content: space-between; font-size: var(--yh-text-sm); color: var(--yh-text-muted); margin-bottom: 6px; }

.yh-spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--yh-border-strong); border-top-color: var(--yh-color-primary); animation: yh-spin .8s linear infinite; vertical-align: middle; flex: none; }
.yh-spinner--sm { width: 14px; height: 14px; }
.yh-spinner--lg { width: 28px; height: 28px; border-width: 3px; }

.yh-skeleton { display: block; height: 14px; border-radius: var(--yh-radius-xs); background: linear-gradient(90deg, var(--yh-surface-sunken) 0%, var(--yh-surface-hover) 50%, var(--yh-surface-sunken) 100%); background-size: 200% 100%; animation: yh-shimmer 1.4s ease-in-out infinite; }
.yh-skeleton--title { height: 22px; width: 45%; }
.yh-skeleton--text { width: 100%; margin-top: 8px; }
.yh-skeleton--short { width: 60%; }
.yh-skeleton--circle { width: 44px; height: 44px; border-radius: 50%; }
.yh-skeleton--block { height: 96px; border-radius: var(--yh-radius-md); }

.yh-empty { text-align: center; padding: 42px 22px; }
.yh-empty__icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: var(--yh-radius-lg); display: grid; place-items: center; background: var(--yh-surface-sunken); color: var(--yh-text-muted); }
.yh-empty__title { font-size: var(--yh-text-xl); font-weight: var(--yh-weight-bold); margin: 0 0 6px; }
.yh-empty__text { color: var(--yh-text-muted); max-width: 440px; margin: 0 auto var(--yh-space-5); }

/* =========================================================================
   14. CODE / LOG, STEPS, PAGINATION, MISC
   ========================================================================= */
.yh-code { display: block; font-family: var(--yh-font-mono); font-size: var(--yh-text-sm); background: var(--yh-surface-sunken); border: 1px solid var(--yh-border); border-radius: var(--yh-radius-md); padding: 12px 14px; overflow-x: auto; white-space: pre; line-height: 1.6; margin: 0 0 var(--yh-space-4); }
.yh-log { font-family: var(--yh-font-mono); font-size: var(--yh-text-xs); background: var(--yh-gray-950); color: #d8dbe0; border-radius: var(--yh-radius-md); padding: 12px 14px; max-height: 280px; overflow: auto; white-space: pre-wrap; line-height: 1.65; margin: 0; }
.yh-log__ok { color: var(--yh-ok-300); } .yh-log__warn { color: var(--yh-amber-300); } .yh-log__err { color: var(--yh-red-300); } .yh-log__dim { color: var(--yh-gray-400); }
.yh-copy-row { display: flex; gap: var(--yh-space-3); align-items: center; }
.yh-copy-row .yh-input { flex: 1; min-width: 0; font-family: var(--yh-font-mono); font-size: var(--yh-text-sm); }
.yh-steps { padding-left: 22px; margin: 0 0 var(--yh-space-4); }
.yh-steps li { margin-bottom: 10px; }
.yh-pagination { display: flex; gap: var(--yh-space-2); align-items: center; flex-wrap: wrap; list-style: none; padding: 0; margin: var(--yh-space-5) 0 0; }
.yh-pagination__item { display: inline-grid; place-items: center; min-width: var(--yh-control-h-sm); height: var(--yh-control-h-sm); padding: 0 10px; border-radius: var(--yh-radius-sm); border: 1px solid var(--yh-border); background: var(--yh-surface-raised); color: var(--yh-text); font-size: var(--yh-text-sm); font-weight: var(--yh-weight-semibold); }
.yh-pagination__item:hover { border-color: var(--yh-border-strong); text-decoration: none; }
.yh-pagination__item[aria-current] { background: var(--yh-color-primary); border-color: var(--yh-color-primary); color: var(--yh-color-primary-on); }
.yh-pagination__item[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.yh-pagination__gap { color: var(--yh-text-muted); padding: 0 4px; }
.yh-choice { position: relative; display: flex; flex-direction: column; gap: var(--yh-space-1); padding: 10px; border: 2px solid var(--yh-border); border-radius: var(--yh-radius-md); cursor: pointer; font-weight: var(--yh-weight-semibold); transition: border-color var(--yh-dur-base) var(--yh-ease); }
.yh-choice:hover { border-color: var(--yh-border-strong); }
.yh-choice input { position: absolute; opacity: 0; pointer-events: none; }
.yh-choice:has(input:checked) { border-color: var(--yh-color-primary); box-shadow: var(--yh-focus-ring); }
.yh-choice:has(input:focus-visible) { box-shadow: var(--yh-focus-ring); }
.yh-choice__hint { color: var(--yh-text-muted); font-size: var(--yh-text-xs); font-weight: var(--yh-weight-medium); }
.yh-divider { height: 1px; background: var(--yh-border); border: 0; margin: var(--yh-space-5) 0; }

/* =========================================================================
   15. UTILITIES (use sparingly; prefer components)
   ========================================================================= */
.yh-u-muted { color: var(--yh-text-muted); }
.yh-u-small { font-size: var(--yh-text-sm); }
.yh-u-xs { font-size: var(--yh-text-xs); }
.yh-u-bold { font-weight: var(--yh-weight-bold); }
.yh-u-mono { font-family: var(--yh-font-mono); }
.yh-u-nowrap { white-space: nowrap; }
.yh-u-pre { white-space: pre-line; }
.yh-u-flip { transform: scaleX(-1); }
.yh-u-right { text-align: right; }
.yh-u-center { text-align: center; }
.yh-u-grow { flex: 1; min-width: 0; }
.yh-u-mt-0 { margin-top: 0; } .yh-u-mt-3 { margin-top: var(--yh-space-3); } .yh-u-mt-5 { margin-top: var(--yh-space-5); } .yh-u-mt-7 { margin-top: var(--yh-space-7); }
.yh-u-mb-0 { margin-bottom: 0; } .yh-u-mb-3 { margin-bottom: var(--yh-space-3); } .yh-u-mb-5 { margin-bottom: var(--yh-space-5); }
.yh-u-success { color: var(--yh-success-fg); } .yh-u-warning { color: var(--yh-warning-fg); } .yh-u-danger { color: var(--yh-text-danger); }
.yh-u-hidden, [hidden] { display: none !important; } /* !important: "hidden" must always win */
.yh-u-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; }

/* =========================================================================
   16. RESPONSIVE, MOTION, PRINT
   ========================================================================= */
@keyframes yh-spin { to { transform: rotate(360deg); } }
@keyframes yh-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes yh-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes yh-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes yh-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@keyframes yh-pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--yh-color-primary-rgb), .55); } 70% { box-shadow: 0 0 0 8px rgba(var(--yh-color-primary-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--yh-color-primary-rgb), 0); } }

@media (max-width: 1100px) { .yh-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .yh-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .yh-app__subnav { display: none; }
  .yh-grid--2, .yh-grid--3, .yh-form-grid, .yh-form-grid--3 { grid-template-columns: 1fr; }
  .yh-app__content { padding: 20px 16px 28px; }
  .yh-field--inline { grid-template-columns: 1fr; gap: 0; }
  .yh-field--inline .yh-field__label { margin-top: 0; }
}
@media (max-width: 760px) {
  .yh-app__rail { position: fixed; top: 64px; bottom: 0; left: 0; height: auto; z-index: var(--yh-z-rail); transform: translateX(-110%); transition: transform var(--yh-dur-base) var(--yh-ease); box-shadow: var(--yh-shadow-lg); border-radius: 0; }
  .yh-app.is-nav-open .yh-app__rail { transform: none; }
  .yh-app__body { margin: 0; border-radius: 0; }
  .yh-grid--4 { grid-template-columns: 1fr; }
  .yh-list__item { flex-wrap: wrap; }
  .yh-list__actions { width: 100%; justify-content: flex-start; }
  .yh-kv { grid-template-columns: 1fr; }
  .yh-kv dd { border-top: 0; padding-top: 0; }
  .yh-h1, :where(.yh) h1 { font-size: 22px; }
  [data-yh-tip]::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  :where(.yh) *, :where(.yh) *::before, :where(.yh) *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; } /* !important: user preference beats every component */
}
@media print {
  .yh-app__top, .yh-app__rail, .yh-app__subnav, .yh-btn, .yh-toasts { display: none !important; }
  .yh-card { box-shadow: none; break-inside: avoid; }
}

/* =========================================================================
   17. v1.1 — polished controls and progressively enhanced select
   ========================================================================= */
:root {
  --yh-control-bg: var(--yh-surface);
  --yh-control-border: rgba(255,255,255,.36);
  --yh-text-muted: #a0a0a0;
  --yh-menu-gap: var(--yh-space-3);
  --yh-menu-max-h: 360px;
  --yh-menu-min-w: 220px;
  --yh-menu-check-size: 18px;
  --yh-menu-shadow: var(--yh-shadow-lg);
  --yh-option-hover: rgba(var(--yh-color-primary-rgb), .08);
  --yh-option-selected: rgba(var(--yh-color-primary-rgb), .14);
  --yh-focus-outline: 2px solid var(--yh-color-primary-text);
}
[data-yh-theme="light"], html[data-theme="light"] {
  --yh-control-bg: var(--yh-surface-raised);
  --yh-control-border: #858a93;
  --yh-text-muted: #646973;
}
@media (prefers-color-scheme: light) {
  [data-yh-theme="auto"] { --yh-control-bg: var(--yh-surface-raised); --yh-control-border: #858a93; --yh-text-muted: #646973; }
}
.yh-input, .yh-select, .yh-textarea { background-color: var(--yh-control-bg); border-color: var(--yh-control-border); }
.yh-field__label { font-weight: var(--yh-weight-medium); }
.yh-btn { font-weight: var(--yh-weight-semibold); }
.yh-card { box-shadow: var(--yh-shadow-sm); }
.yh-card--flat { box-shadow: none; }
.yh-card__header { gap: var(--yh-space-5); }
.yh-table th { font-weight: var(--yh-weight-medium); }
.yh-menu__list { border-color: var(--yh-border-strong); padding: var(--yh-space-3); min-width: var(--yh-menu-min-w); }
.yh-menu__item, .yh-combobox__option { min-height: var(--yh-control-h-md); }
.yh-menu__item:hover, .yh-combobox__option:hover { background: var(--yh-option-hover); }
.yh-menu__item:focus-visible, .yh-combobox__option:focus-visible { outline: var(--yh-focus-outline); outline-offset: -2px; background: var(--yh-option-hover); }
.yh-menu__item[disabled], .yh-combobox__option[disabled] { opacity: .45; cursor: not-allowed; }
.yh-combobox__pop { padding: var(--yh-space-3); }
.yh-combobox__list { scrollbar-width: thin; scrollbar-color: var(--yh-border-strong) transparent; }
.yh-selectbox { position: relative; width: 100%; min-width: 0; }
/* Keep the actual select in forms, validation and no-JS fallback. */
.yh-select.yh-select--enhanced { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.yh-selectbox__trigger { display: flex; align-items: center; gap: var(--yh-space-3); width: 100%; height: var(--yh-control-h-md); padding: 0 var(--yh-space-4); background: var(--yh-control-bg); color: var(--yh-text); border: 1px solid var(--yh-control-border); border-radius: var(--yh-radius-md); font: inherit; font-size: var(--yh-text-md); text-align: left; cursor: pointer; transition: border-color var(--yh-dur-base), box-shadow var(--yh-dur-base); }
.yh-selectbox__trigger:hover { border-color: var(--yh-color-primary-text); }
.yh-selectbox__trigger:focus-visible, .yh-selectbox__trigger[aria-expanded="true"] { outline: none; border-color: var(--yh-color-primary-text); box-shadow: var(--yh-focus-ring); }
.yh-selectbox__trigger:disabled { opacity: .55; cursor: not-allowed; }
.yh-selectbox__trigger[aria-invalid="true"], .yh-field--error .yh-selectbox__trigger { border-color: var(--yh-color-danger); }
.yh-field--success .yh-selectbox__trigger { border-color: var(--yh-color-success); }
.yh-selectbox__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yh-selectbox__trigger.is-placeholder .yh-selectbox__value { color: var(--yh-text-muted); }
.yh-selectbox__chevron { flex: none; width: var(--yh-menu-check-size); height: var(--yh-menu-check-size); color: var(--yh-text-muted); transition: transform var(--yh-dur-base); }
.yh-selectbox__trigger[aria-expanded="true"] .yh-selectbox__chevron { transform: rotate(180deg); color: var(--yh-color-primary-text); }
.yh-selectbox__count { flex: none; padding: var(--yh-space-1) var(--yh-space-3); border-radius: var(--yh-radius-sm); background: var(--yh-option-selected); color: var(--yh-color-primary-text); font-size: var(--yh-text-xs); font-weight: var(--yh-weight-semibold); }
.yh-select--sm ~ .yh-selectbox__trigger { height: var(--yh-control-h-sm); font-size: var(--yh-text-sm); }
.yh-select--lg ~ .yh-selectbox__trigger { height: var(--yh-control-h-lg); font-size: var(--yh-text-lg); }
.yh-select--pill ~ .yh-selectbox__trigger { border-radius: var(--yh-radius-pill); }
.yh-selectbox__panel { position: absolute; inset: auto 0 auto 0; top: calc(100% + var(--yh-menu-gap)); width: auto; margin: 0; padding: var(--yh-space-3); background: var(--yh-surface-raised); color: var(--yh-text); border: 1px solid var(--yh-border-strong); border-radius: var(--yh-radius-md); box-shadow: var(--yh-menu-shadow); z-index: var(--yh-z-dropdown); max-height: var(--yh-menu-max-h); overflow: hidden; display: flex; flex-direction: column; gap: var(--yh-space-3); font: var(--yh-text-md)/var(--yh-leading-normal) var(--yh-font); }
.yh-selectbox__panel[popover] { position: fixed; inset: auto; left: var(--yh-select-left); top: var(--yh-select-top); width: var(--yh-select-width); max-height: var(--yh-select-max-h, var(--yh-menu-max-h)); }
.yh-selectbox__panel::backdrop { background: transparent; }
.yh-selectbox__search-wrap { display: flex; flex: none; align-items: center; gap: var(--yh-space-3); border-bottom: 1px solid var(--yh-border); padding: var(--yh-space-2) var(--yh-space-2) var(--yh-space-3); }
.yh-selectbox__search-wrap .yh-icon { color: var(--yh-text-muted); flex: none; }
.yh-selectbox__search { border: 0; outline: none; box-shadow: none; background: transparent; width: 100%; min-width: 0; color: var(--yh-text); font: inherit; height: var(--yh-control-h-sm); }
.yh-selectbox__search:focus-visible { box-shadow: none; outline: none; }
.yh-selectbox__search-wrap:focus-within { border-bottom-color: var(--yh-color-primary-text); }
.yh-selectbox__search::placeholder { color: var(--yh-text-muted); }
.yh-selectbox__list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--yh-border-strong) transparent; }
.yh-selectbox__option { display: flex; align-items: center; gap: var(--yh-space-4); width: 100%; min-height: var(--yh-control-h-md); border: 0; border-radius: var(--yh-radius-sm); padding: var(--yh-space-3) var(--yh-space-4); background: transparent; color: var(--yh-text); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.yh-selectbox__option:hover, .yh-selectbox__option:focus-visible { background: var(--yh-option-hover); }
.yh-selectbox__option:focus-visible { outline: var(--yh-focus-outline); outline-offset: -2px; box-shadow: none; }
.yh-selectbox__option[aria-selected="true"] { background: var(--yh-option-selected); font-weight: var(--yh-weight-semibold); }
.yh-selectbox__option[disabled] { opacity: .45; cursor: not-allowed; }
.yh-selectbox__option-label { flex: 1; }
.yh-selectbox__check { width: var(--yh-menu-check-size); height: var(--yh-menu-check-size); flex: none; color: var(--yh-color-primary-text); opacity: 0; }
.yh-selectbox__option[aria-selected="true"] .yh-selectbox__check { opacity: 1; }
.yh-selectbox__panel--multiple .yh-selectbox__check { opacity: 1; border: 1px solid var(--yh-control-border); border-radius: var(--yh-radius-xs); color: transparent; padding: var(--yh-space-1); }
.yh-selectbox__panel--multiple [aria-selected="true"] .yh-selectbox__check { color: var(--yh-color-primary-on); background: var(--yh-color-primary); border-color: var(--yh-color-primary); }
.yh-selectbox__group { color: var(--yh-text-muted); font-size: var(--yh-text-xs); font-weight: var(--yh-weight-semibold); padding: var(--yh-space-4) var(--yh-space-4) var(--yh-space-2); }
.yh-selectbox__empty { padding: var(--yh-space-7) var(--yh-space-4); text-align: center; color: var(--yh-text-muted); }
.yh-selectbox__footer { display: flex; flex: none; align-items: center; justify-content: space-between; gap: var(--yh-space-3); padding-top: var(--yh-space-3); border-top: 1px solid var(--yh-border); font-size: var(--yh-text-xs); color: var(--yh-text-muted); }
.yh-selectbox__footer-actions { display: flex; gap: var(--yh-space-2); }
.yh-selectbox__native-focus .yh-selectbox__trigger { border-color: var(--yh-color-primary-text); box-shadow: var(--yh-focus-ring); }
@media (max-width: 760px) { .yh-selectbox__option { min-height: var(--yh-control-h-lg); } .yh-selectbox__search { font-size: 16px; } }
@media (forced-colors: active) { .yh-selectbox__option[aria-selected="true"] { outline: 1px solid Highlight; } .yh-selectbox__check { forced-color-adjust: none; } }
@media print { .yh-selectbox__panel { display: none !important; } }

:where(.yh) p a:not(.yh-btn), .yh-app__foot a { text-decoration: underline; text-underline-offset: .2em; }

/* 18. Popup and developer-facing panels */
:root { --yh-code-line-h: 1.85; --yh-code-max-h: 340px; --yh-popup-w: 340px; }
.yh-modal { max-height: calc(100dvh - var(--yh-space-8)); }
.yh-modal__body { padding-bottom: var(--yh-space-5); }
.yh-modal__footer { border-top: 1px solid var(--yh-border); padding-top: var(--yh-space-5); }
.yh-alert__icon { width: var(--yh-control-h-lg); height: var(--yh-control-h-lg); display: grid; place-items: center; border-radius: var(--yh-radius-md); margin-bottom: var(--yh-space-5); background: var(--yh-info-bg); color: var(--yh-info-fg); }
.yh-alert--success .yh-alert__icon { background: var(--yh-success-bg); color: var(--yh-success-fg); }
.yh-alert--warning .yh-alert__icon { background: var(--yh-warning-bg); color: var(--yh-warning-fg); }
.yh-alert--danger .yh-alert__icon { background: var(--yh-danger-bg); color: var(--yh-danger-fg); }
.yh-popup { position: relative; display: inline-block; }
.yh-popup__panel { position: absolute; left: 0; top: calc(100% + var(--yh-menu-gap)); margin: 0; width: min(var(--yh-popup-w), calc(100vw - var(--yh-space-7))); max-height: min(480px, 70dvh); overflow-y: auto; padding: 0; background: var(--yh-surface-raised); color: var(--yh-text); border: 1px solid var(--yh-border-strong); border-radius: var(--yh-radius-lg); box-shadow: var(--yh-shadow-lg); z-index: var(--yh-z-dropdown); font: var(--yh-text-md)/var(--yh-leading-normal) var(--yh-font); }
.yh-popup__panel[popover] { position: fixed; inset: auto; left: var(--yh-popup-left); top: var(--yh-popup-top); max-height: var(--yh-popup-max-h, 480px); }
.yh-popup__panel::backdrop { background: transparent; }
.yh-popup__header { display: flex; align-items: center; justify-content: space-between; gap: var(--yh-space-4); padding: var(--yh-space-4) var(--yh-space-5); border-bottom: 1px solid var(--yh-border); }
.yh-popup__body { padding: var(--yh-space-5); }
.yh-popup__body > :last-child { margin-bottom: 0; }
.yh-codeblock, .yh-logview { width: 100%; min-width: 0; background: var(--yh-surface-raised); border: 1px solid var(--yh-border-strong); border-radius: var(--yh-radius-md); overflow: hidden; }
.yh-codeblock__header { display: flex; align-items: center; gap: var(--yh-space-3); min-height: var(--yh-control-h-lg); padding: var(--yh-space-3) var(--yh-space-5); border-bottom: 1px solid var(--yh-border); background: var(--yh-surface-raised); }
.yh-codeblock__name { flex: 1; min-width: 0; font-size: var(--yh-text-sm); font-weight: var(--yh-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yh-codeblock__language { color: var(--yh-text-muted); font-family: var(--yh-font-mono); font-size: var(--yh-text-xs); }
.yh-codeblock__pre { counter-reset: yh-line; max-height: var(--yh-code-max-h); overflow: auto; margin: 0; padding: var(--yh-space-5) 0; background: var(--yh-control-bg); font: var(--yh-text-sm)/var(--yh-code-line-h) var(--yh-font-mono); white-space: normal; tab-size: 2; scrollbar-width: thin; }
.yh-codeblock__pre code { display: block; min-width: 100%; width: max-content; background: none; padding: 0; font: inherit; color: var(--yh-text); }
.yh-codeblock__line { display: block; position: relative; white-space: pre; min-height: 1lh; padding: 0 var(--yh-space-5); }
.yh-codeblock--numbered .yh-codeblock__line { padding-left: var(--yh-space-10); }
.yh-codeblock--numbered .yh-codeblock__line::before { counter-increment: yh-line; content: counter(yh-line); position: absolute; left: 0; width: var(--yh-space-8); padding-right: var(--yh-space-3); text-align: right; color: var(--yh-text-muted); border-right: 1px solid var(--yh-border); user-select: none; }
.yh-codeblock__line:hover { background: var(--yh-option-hover); }
.yh-codeblock--wrap .yh-codeblock__pre code { width: 100%; }
.yh-codeblock--wrap .yh-codeblock__line { white-space: pre-wrap; overflow-wrap: anywhere; }
.yh-codeblock__caption { padding: var(--yh-space-3) var(--yh-space-5); border-top: 1px solid var(--yh-border); color: var(--yh-text-muted); font-size: var(--yh-text-xs); }
.yh-logview__filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--yh-space-3); padding: var(--yh-space-4) var(--yh-space-5); border-bottom: 1px solid var(--yh-border); }
.yh-logview__filters [data-yh-log-count] { margin-left: auto; }
.yh-logview__entries { max-height: var(--yh-code-max-h); overflow: auto; background: var(--yh-control-bg); padding: var(--yh-space-3) 0; }
.yh-logview__row { display: grid; grid-template-columns: 68px 72px minmax(0,1fr); gap: var(--yh-space-4); padding: var(--yh-space-3) var(--yh-space-5); font: var(--yh-text-xs)/var(--yh-leading-normal) var(--yh-font-mono); }
.yh-logview__row:hover { background: var(--yh-option-hover); }
.yh-logview__row time { color: var(--yh-text-muted); }
.yh-logview__level { font-weight: var(--yh-weight-semibold); color: var(--yh-info-fg); }
.yh-logview__level--success { color: var(--yh-success-fg); } .yh-logview__level--warning { color: var(--yh-warning-fg); } .yh-logview__level--danger { color: var(--yh-danger-fg); }
.yh-logview__message { overflow-wrap: anywhere; white-space: pre-wrap; }
.yh-logview__empty { padding: var(--yh-space-7); text-align: center; color: var(--yh-text-muted); }
@media (max-width:760px) { .yh-codeblock__header { padding-inline: var(--yh-space-4); } .yh-codeblock__language { display: none; } .yh-logview__row { grid-template-columns: 60px minmax(0,1fr); gap: var(--yh-space-3); } .yh-logview__message { grid-column: 1 / -1; } }

/* 19. v1.2 workflows: forms, tables, drawer, syntax and staged uploads. */
:root { --yh-syntax-keyword:#c3a7ff; --yh-syntax-string:var(--yh-success-fg); --yh-syntax-number:var(--yh-warning-fg); --yh-syntax-attribute:var(--yh-info-fg); --yh-drawer-w:480px; }
[data-yh-theme="light"],html[data-theme="light"] { --yh-syntax-keyword:#654098; }
@media(prefers-color-scheme:light){[data-yh-theme="auto"]{--yh-syntax-keyword:#654098;}}
.yh-syntax--keyword{color:var(--yh-syntax-keyword);} .yh-syntax--string{color:var(--yh-syntax-string);} .yh-syntax--number{color:var(--yh-syntax-number);} .yh-syntax--attribute{color:var(--yh-syntax-attribute);} .yh-syntax--comment{color:var(--yh-text-muted);}
.yh-codeblock__line.is-highlighted{background:var(--yh-option-selected);box-shadow:inset 3px 0 var(--yh-color-primary-text);}
.yh-password{position:relative;} .yh-password .yh-input{padding-right:var(--yh-space-10);}
.yh-password__toggle{position:absolute;right:var(--yh-space-2);top:var(--yh-space-2);bottom:var(--yh-space-2);width:var(--yh-control-h-sm);border:0;border-radius:var(--yh-radius-sm);background:transparent;color:var(--yh-text-muted);cursor:pointer;display:grid;place-items:center;}
.yh-password__toggle:hover{background:var(--yh-surface-hover);color:var(--yh-text);} .yh-password__toggle:disabled{opacity:.5;cursor:not-allowed;}
.yh-form-savebar{display:flex;align-items:center;justify-content:space-between;gap:var(--yh-space-4);flex-wrap:wrap;padding:var(--yh-space-5) 0;border-top:1px solid var(--yh-border);margin-top:var(--yh-space-7);}
[data-yh-form-status]{font-size:var(--yh-text-sm);color:var(--yh-text-muted);} .is-dirty [data-yh-form-status]{color:var(--yh-warning-fg);}
.yh-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(var(--yh-drawer-w),100vw);height:100dvh;max-height:100dvh;border-radius:var(--yh-radius-lg) 0 0 var(--yh-radius-lg);display:none;flex-direction:column;}
.yh-drawer[open]{display:flex;} .yh-drawer .yh-modal__header{flex:none;padding:var(--yh-space-6);border-bottom:1px solid var(--yh-border);} .yh-drawer .yh-modal__body{flex:1;min-height:0;max-height:none;overflow:auto;padding:var(--yh-space-6);} .yh-drawer .yh-modal__footer{flex:none;padding:var(--yh-space-5) var(--yh-space-6);}
.yh-datatable{width:100%;min-width:0;border:1px solid var(--yh-border);border-radius:var(--yh-radius-lg);overflow:hidden;background:var(--yh-surface-raised);}
.yh-datatable__toolbar{display:flex;align-items:center;gap:var(--yh-space-4);flex-wrap:wrap;padding:var(--yh-space-5);border-bottom:1px solid var(--yh-border);} .yh-datatable__toolbar>.yh-input-icon{flex:1;min-width:180px;} .yh-datatable__toolbar>.yh-selectbox{width:200px;}
.yh-datatable__bulk{display:flex;align-items:center;gap:var(--yh-space-3);flex-wrap:wrap;padding:var(--yh-space-4) var(--yh-space-5);background:var(--yh-option-selected);font-size:var(--yh-text-sm);} .yh-datatable__bulk>b{margin-right:auto;}
.yh-datatable__sort{display:inline-flex;align-items:center;gap:var(--yh-space-3);font:inherit;font-weight:var(--yh-weight-medium);border:0;padding:var(--yh-space-2) 0;background:transparent;color:inherit;cursor:pointer;} [aria-sort=ascending] .yh-datatable__sort,[aria-sort=descending] .yh-datatable__sort{color:var(--yh-color-primary-text);}
.yh-datatable input[type=checkbox]{width:16px;height:16px;accent-color:var(--yh-color-primary);cursor:pointer;} .yh-datatable__select{width:var(--yh-space-10);}
.yh-datatable__footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--yh-space-4);padding:var(--yh-space-4) var(--yh-space-5);border-top:1px solid var(--yh-border);font-size:var(--yh-text-sm);color:var(--yh-text-muted);}
.yh-datatable__state{padding:var(--yh-space-9);text-align:center;color:var(--yh-text-muted);} .yh-datatable__state[role=alert]{color:var(--yh-text-danger);}
.yh-upload{width:100%;min-width:0;} .yh-upload:not(.is-enhanced) input[type=file].yh-u-hidden{display:block!important;width:100%;}
.yh-upload__feedback{margin:var(--yh-space-3) 0;color:var(--yh-text-muted);font-size:var(--yh-text-sm);overflow-wrap:anywhere;} .yh-upload__feedback:empty{display:none;} .yh-upload__feedback.is-error{color:var(--yh-text-danger);}
.yh-upload__files{padding:0;margin:var(--yh-space-4) 0;list-style:none;display:grid;gap:var(--yh-space-3);} .yh-upload__file{display:flex;align-items:center;gap:var(--yh-space-4);padding:var(--yh-space-4);border:1px solid var(--yh-border);border-radius:var(--yh-radius-md);background:var(--yh-surface-raised);}
.yh-upload__preview{width:var(--yh-control-h-lg);height:var(--yh-control-h-lg);border-radius:var(--yh-radius-sm);background:var(--yh-surface-sunken);display:grid;place-items:center;flex:none;overflow:hidden;color:var(--yh-text-muted);} .yh-upload__preview img{width:100%;height:100%;object-fit:cover;}
.yh-upload__meta{flex:1;min-width:0;font-size:var(--yh-text-sm);} .yh-upload__meta b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--yh-weight-medium);} .yh-upload__meta small{display:block;color:var(--yh-text-muted);}
.yh-upload__progress{margin-top:var(--yh-space-5);}
.yh-layout{width:100%;max-width:1200px;margin:0 auto;padding:var(--yh-space-8);} .yh-layout__columns{display:grid;grid-template-columns:minmax(0,2fr) minmax(240px,1fr);gap:var(--yh-space-6);} .yh-layout__sidebar{position:sticky;top:var(--yh-space-8);align-self:start;}
.yh-settings-layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:var(--yh-space-8);} .yh-settings-nav{display:flex;flex-direction:column;gap:var(--yh-space-2);} .yh-settings-nav a{display:flex;gap:var(--yh-space-3);padding:var(--yh-space-4);color:var(--yh-text-muted);border-radius:var(--yh-radius-md);} .yh-settings-nav a[aria-current]{background:var(--yh-option-selected);color:var(--yh-color-primary-text);}
.yh-detail-hero{display:flex;align-items:center;gap:var(--yh-space-5);margin-bottom:var(--yh-space-7);} .yh-detail-hero .yh-h1{margin-bottom:var(--yh-space-2);}
@media(max-width:900px){.yh-layout{padding:var(--yh-space-5);}.yh-layout__columns,.yh-settings-layout{grid-template-columns:1fr;}.yh-layout__sidebar{position:static;}.yh-settings-nav{flex-direction:row;flex-wrap:wrap;}}
@media(max-width:760px){.yh-datatable__toolbar>.yh-selectbox{width:100%;}.yh-codeblock__header{flex-wrap:wrap;}.yh-codeblock__name{flex-basis:100%;}.yh-drawer{border-radius:0;}.yh-datatable__bulk .yh-btn{max-width:100%;}.yh-layout .yh-page-header__actions{width:100%;}.yh-layout .yh-page-header__actions .yh-btn{flex:1;}}
@media(max-width:760px){.yh-detail-hero{display:grid;grid-template-columns:auto minmax(0,1fr);}.yh-detail-hero>.yh-btn{grid-column:1/-1;justify-self:start;}}

/* 20. v1.2.2: close tooltips stay inside scrolling popup surfaces. */
.yh-modal__header [data-yh-close][data-yh-tip]::after,
.yh-popup__header [data-yh-popup-close][data-yh-tip]::after {
  display:block; bottom:auto; top:50%; left:auto; right:calc(100% + 8px); transform:translateY(-50%);
  max-width:min(240px,calc(100vw - 48px)); white-space:normal; overflow-wrap:anywhere;
  width:max-content; text-align:left;
}
@media(hover:none){
  .yh-modal__header [data-yh-close][data-yh-tip]::after,
  .yh-popup__header [data-yh-popup-close][data-yh-tip]::after { display:none; }
}
