/* Main-theme picker (js/ui/accent/picker.js): a native <select> cannot paint a colour rect per
   option on every OS, so a small listbox of rect+name rows. */
.accent-swatch {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid var(--border-main);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
    transition: background 0.2s ease;
}
/* The ✓ marks the active preset on its own chip (desktop parity: openAccentPicker), since the row
   tint is the hover's look; a custom hex accent selects no row and marks nothing. */
.accent-check {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.accent-dd-opt[aria-selected="true"] .accent-check { opacity: 1; }
.accent-dd { position: relative; }
.accent-dd-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    padding: 5px 10px;
    font: inherit;
    text-align: left;
    color: var(--input-text);
    background: var(--input-bg);
    border: 1px solid var(--ui-outline);   /* the field's own ink, as every input's box is */
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
/* The trigger is a <button>: the app-wide button:hover accent fill made dark text on violet
   (user report). A field's hover only lights its border. */
/* :not(:disabled): this class otherwise outranks `button:disabled` while hovered, and a disabled
   trigger must read as dead (user report). */
.accent-dd-trigger:hover:not(:disabled) { border-color: var(--accent); background: var(--input-bg); color: var(--input-text); }
.accent-dd-trigger:not(:disabled) { text-shadow: none; }
.accent-dd-trigger:not(:disabled) .ic { filter: none; }
.accent-dd-name { flex: 1 1 auto; }
.accent-dd-caret { color: var(--text-muted); font-size: 11px; }
.accent-dd-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    margin: 0;
    padding: 4px;
    list-style: none;
    min-width: 100%;
    max-height: 280px;
    overflow-y: auto;
    /* macOS hides its overlay scrollbar until it moves, so a capped list looked simply cut off.
       The two `local` covers ride the content and uncover a `scroll` shadow only while rows remain. */
    background:
        /* The thumb (js/ui/control/menuScrollbar.js): `scroll` holds it against the box while the two
           custom properties carry its length and travel. Zero-length — absent — when it fits. */
        linear-gradient(var(--sb-thumb), var(--sb-thumb))
            right 3px top var(--dd-sb-pos, 0px) / 6px var(--dd-sb-len, 0px) no-repeat scroll,
        linear-gradient(var(--bg-container) 40%, rgba(0, 0, 0, 0)) top / 100% 20px no-repeat local,
        linear-gradient(rgba(0, 0, 0, 0), var(--bg-container) 60%) bottom / 100% 20px no-repeat local,
        radial-gradient(farthest-side at 50% 0, var(--shadow), rgba(0, 0, 0, 0)) top / 100% 10px no-repeat scroll,
        radial-gradient(farthest-side at 50% 100%, var(--shadow), rgba(0, 0, 0, 0)) bottom / 100% 10px no-repeat scroll,
        var(--bg-container);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--shadow);
}
.accent-dd-menu[hidden] { display: none; }
/* While open the menu moves to <body> in viewport coordinates (dropdownMenu.js): `.controls` clips
   its overflow. Above every modal and panel, just under #app-tooltip (100003). */
.accent-dd-menu.dd-portal {
    position: fixed;
    right: auto;
    /* No `min-width: 100%`: on <body> that is the viewport, and the list opened at the far left
       (user report). placeMenu sets the real floor inline. */
    min-width: 0;
    z-index: 100002;
}
.accent-dd-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 9px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}
/* `.dd-hover` mirrors :hover but is JS-driven (accentPicker.js), so the previewed row's
   highlight survives the accent flood's View Transition, which drops real :hover. */
.accent-dd-opt:hover, .accent-dd-opt.dd-hover { background: var(--bg-coord-hover); }
.accent-dd-opt[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
/* The logo's copy of the menu (ui/toolbar/toolbar.js) hangs left-aligned under the logo and sizes
   to its rows; max-height:none lifts the 280px cap, and toolbar.js re-caps it to the room below. */
.logo-accent-menu {
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    min-width: 132px;
    max-height: none;
}
/* Hover bridge over the 6px anchor gap, so the hold-Alt peek survives the logo → menu crossing.
   On the wrap's ::after: its ::before is the ray layer. */
.app-logo-wrap:has(.logo-accent-menu:not([hidden]))::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 132px;   /* the menu's min-width — covers a diagonal exit toward the rows */
    height: 8px;
}
/* Lifted while the menu is up: the wrap's own stacking context (z-index:0) lets later toolbar
   content paint over the list. */
.app-logo-wrap:has(.logo-accent-menu:not([hidden])) { z-index: 60; }
/* Custom toolbar selects (customSelect.js): the .accent-dd look sized to content (4px radius,
   14px); the hidden native <select> stays in the DOM as the value source. */
.cs-native { display: none; }
.cs-dd .accent-dd-trigger { min-width: 0; gap: 6px; padding: 8px 12px; border-radius: 4px; font-size: 14px; }
.cs-dd .accent-dd-menu { left: 0; right: auto; min-width: 100%; }
/* Searchable dropdowns: a search input pinned above the rows, and a "no match" row. */
.accent-dd-search-row {
    position: sticky;
    top: -4px;               /* cancel the menu's 4px padding so it pins flush */
    z-index: 1;
    margin: -4px -4px 4px;
    padding: 8px;
    background: var(--bg-container);
    border-bottom: 1px solid var(--border-main);
}
.accent-dd-search {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-main);
    border-radius: 6px;
    background-color: var(--input-bg);   /* not the shorthand — keeps the hover sweep sizing */
    color: var(--input-text);
    font-size: 13px;
}
.accent-dd-no-match {
    padding: 6px 9px;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: default;
}