/*
 * The one menu look (owner, 2026-11-11): every action menu ("..." on a row,
 * the avatar menu, a column header, Download / Upload, Columns, views, sort)
 * and every filter popover, on the dropdown tokens of select-ui.css (--dd-*),
 * so a menu and an open <select> are the same panel with the same rows.
 *
 * Loaded last in the head (partials/select-ui), after the layout and the
 * page stylesheets. Each group is prefixed with :root so it outranks the
 * one- and two-class rules those files still carry for positioning; this
 * file sets only the look (surface, padding, rows, labels, lines), never
 * where a panel sits. Behaviour stays with each menu's own script; the
 * layout's menu script keeps a panel inside the window and out of reach of
 * a clipping table (see "A menu fits the window" in app/layout).
 */

/* The older names other rules still read (the bell, the dock's menus). */
:root{
  --fl-pad:var(--dd-panel-pad,6px);
  --fl-radius:var(--dd-panel-radius,12px);
  --fl-border:1px solid var(--dd-panel-border,#eceef1);
  --fl-shadow:var(--dd-panel-shadow,0 12px 32px -8px rgba(16,24,40,.18),0 4px 8px -4px rgba(16,24,40,.08));
}

/* ---- 1. The panel: one surface for menus and popovers ---- */
:root :is(
  .menu-pop,.ba-menu,.bar-pop,.colmenu-pop,.cm-sub > .is-fly,.pop,.wsw-pop,.run-pop,.start-menu-pop,.sim-menu-pop,.pl-hmenu,.pl-cur-menu,
  .wf-pop,.ctx-menu,.sheet-pop,.pg-size-menu,.al-menu-pop,.ee-pop,.ux-fpop,
  details.sheet-menu > div,details.pg-size > div,.row-menu > :not(summary),.start-menu > :not(summary),
  .fp-agent > :not(summary),.fp-continue > :not(summary),.bell-pop
){
  box-sizing:border-box;border:1px solid var(--dd-panel-border);border-radius:var(--dd-panel-radius);
  background:var(--dd-bg);color:var(--dd-text);box-shadow:var(--dd-panel-shadow);
  text-align:left;font-weight:400;letter-spacing:0;white-space:normal;
  scrollbar-width:thin;scrollbar-color:var(--line-strong,#d0d5dd) transparent;
}
/* Menus read at the dropdown's 14px; editors and notes keep their own size. */
:root :is(.menu-pop,.ba-menu,.bar-pop,.colmenu-pop,.cm-sub > .is-fly,.pop,.wsw-pop,.run-pop,.start-menu-pop,.sim-menu-pop,.pl-hmenu,.pl-cur-menu,.wf-pop,.ctx-menu,.sheet-pop,.pg-size-menu,.al-menu-pop):not(.fil-pop):not(.srt-pop):not(.rp):not(.info-pop):not(.cm-form){font-size:var(--dd-row-font);line-height:1.4}
:root :is(.menu-pop,.ba-menu,.bar-pop,.colmenu-pop,.cm-sub > .is-fly,.pop,.wsw-pop,.run-pop,.wf-pop,.ctx-menu,.ee-pop,.ux-fpop,.wsw-list,.col-list)::-webkit-scrollbar{width:8px;height:8px}
:root :is(.menu-pop,.ba-menu,.bar-pop,.colmenu-pop,.cm-sub > .is-fly,.pop,.wsw-pop,.run-pop,.wf-pop,.ctx-menu,.ee-pop,.ux-fpop,.wsw-list,.col-list)::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:8px;background:var(--line-strong,#d0d5dd);background-clip:padding-box}
:root :is(.menu-pop,.ba-menu,.bar-pop,.colmenu-pop,.cm-sub > .is-fly,.pop,.wsw-pop,.run-pop,.wf-pop,.ctx-menu,.ee-pop,.ux-fpop,.wsw-list,.col-list)::-webkit-scrollbar-track{background:transparent}

/* Menus (lists of actions) take the dropdown's 6px inset and scroll inside
   the window. Editors keep their own inset: the filter and sort builders, the
   rows panel, the save-view form (.menu-pop.card), the filter popovers. */
:root :is(
  .menu-pop,.ba-menu,.bar-pop,.colmenu-pop,.cm-sub > .is-fly,.pop,.wsw-pop,.run-pop,.start-menu-pop,.sim-menu-pop,.wf-pop,.pl-hmenu,.pl-cur-menu,
  .ctx-menu,.sheet-pop,.pg-size-menu,.al-menu-pop,details.sheet-menu > div,details.pg-size > div
):not(.fil-pop):not(.srt-pop):not(.rp):not(.info-pop):not(.ux-fpop):not(.ea-fpop):not(.cm-form):not(.is-form):not(.card){
  padding:var(--dd-panel-pad);
}
:root :is(.menu-pop,.bar-pop,.colmenu-pop,.pop,.run-pop,.start-menu-pop,.sim-menu-pop,.ctx-menu,.pg-size-menu,.al-menu-pop,
  .row-menu > :not(summary),.start-menu > :not(summary),details.sheet-menu > div,details.pg-size > div
):not(.fil-pop):not(.col-pop):not(.srt-pop):not(.rp){max-height:min(560px,calc(100vh - 16px));overflow-y:auto}

/* ---- 2. Rows: plain 36px rows, 8px corners, a light hover ---- */
:root :is(
  .menu-item,.pop-item,.wsw-item,.zm-item,.vw-item,.col-row,.col-fly-row,.wf-pop-item,.dx-mi,.mr-more-item,.menu-pop > label,
  .ba-menu > a,.ba-menu > button,.ba-menu > form > button,.sim-menu-pop > button,.sim-menu-pop > a,.sim-menu-pop > form > button,
  .run-pop > a,.run-pop > button,.start-menu-pop > a,.al-menu-pop > a,.al-menu-pop > button,.pg-size-menu > a,.pg-size-menu > button,
  .ee-pop > button,.cm-sub > summary
){
  display:flex;align-items:center;gap:10px;box-sizing:border-box;width:100%;min-height:var(--dd-row-h);height:auto;margin:0;
  padding:6px var(--dd-row-pad);border:0;border-radius:var(--dd-row-radius);background:none;color:var(--dd-text);
  font:inherit;font-size:var(--dd-row-font);font-weight:400;line-height:20px;text-align:left;text-decoration:none;cursor:pointer;
}
:root :is(
  .menu-item,.pop-item,.wsw-item,.zm-item,.vw-item,.col-row,.col-fly-row,.wf-pop-item,.dx-mi,.mr-more-item,.menu-pop > label,
  .ba-menu > a,.ba-menu > button,.ba-menu > form > button,.sim-menu-pop > button,.sim-menu-pop > a,.sim-menu-pop > form > button,
  .run-pop > a,.run-pop > button,.start-menu-pop > a,.al-menu-pop > a,.al-menu-pop > button,.pg-size-menu > a,.pg-size-menu > button,
  .ee-pop > button,.cm-sub > summary
):is(:hover,:focus-visible,.is-active){background:var(--dd-row-hover);color:var(--dd-text);outline:none}
:root :is(.menu-item,.pop-item,.wsw-item,.zm-item,.vw-item,.col-row,.wf-pop-item,.ba-menu > a,.ba-menu > button):focus-visible{box-shadow:inset 0 0 0 2px var(--dd-ring)}
/* The one that is chosen now (this workspace, this view, this sort). */
:root :is(.menu-item,.wsw-item,.vw-item,.wf-pop-item,.ba-menu > a,.ba-menu > button,.pg-size-menu > a):is([aria-current="true"],[aria-current="page"],.is-on,.is-cur){
  background:var(--dd-row-selected);color:var(--dd-row-selected-text);font-weight:500}
/* A row that cannot be used. */
:root :is(.menu-item,.pop-item,.zm-item,.vw-item,.wf-pop-item,.ba-menu > a,.ba-menu > button):is([disabled],.is-disabled,.is-off,.is-locked){color:var(--dd-placeholder);cursor:default}
:root :is(.menu-item,.pop-item,.zm-item,.vw-item,.wf-pop-item,.ba-menu > a,.ba-menu > button):is([disabled],[aria-disabled="true"],.is-disabled,.is-off):hover{background:none;cursor:default}

/* Two-line rows (a preset with its note) stack their lines. */
:root .menu-pop > label > input{flex:none;margin:0}
:root .ba-menu > .wu-pm-i{align-items:flex-start;justify-content:center;gap:2px;min-height:44px}

/* Icons line up: one fixed box at the start of the row, muted. */
:root :is(.menu-item,.pop-item,.wsw-item,.vw-item,.wf-pop-item,.dx-mi,.ba-menu > a,.ba-menu > button,.cm-sub > summary) > :is(svg,.ico){flex:none;color:var(--dd-muted)}
:root :is(.menu-item,.pop-item,.wsw-item,.wf-pop-item,.ba-menu > a,.ba-menu > button) > .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
:root :is(.menu-item,.pop-item,.wsw-item,.zm-item,.wf-pop-item) small{color:var(--dd-muted);font-size:12px}
/* The chosen row's tick reads in the brand colour. */
:root :is(.wsw-item,.vw-item,.menu-item).is-on > :is(svg,.ico):last-child{color:var(--dd-focus)}

/* Delete and the like: the app's red, a red hover. */
:root :is(.menu-item,.pop-item,.zm-item,.wf-pop-item,.mr-more-item,.ba-menu > a,.ba-menu > button,.ba-menu > form > button,.sim-menu-pop > button,.sim-menu-del,.cm2-del .menu-item).is-danger,
:root .sim-menu-del,:root .ba-menu .is-danger{color:var(--red,#d92d20)}
:root :is(.menu-item,.pop-item,.zm-item,.wf-pop-item,.mr-more-item,.ba-menu > a,.ba-menu > button,.ba-menu > form > button,.sim-menu-pop > button).is-danger:is(:hover,:focus-visible),
:root .sim-menu-del:is(:hover,:focus-visible){background:var(--red-soft,#fef3f2);color:var(--red,#d92d20)}
:root :is(.menu-item,.pop-item,.zm-item,.wf-pop-item,.ba-menu > a,.ba-menu > button).is-danger > :is(svg,.ico){color:currentColor}

/* ---- 3. Group labels and separators ---- */
:root :is(.menu-label,.wsw-label,.zm-sect,.wf-pop-h,.ib-mlabel){
  display:flex;align-items:center;gap:6px;margin:0;padding:8px var(--dd-row-pad) 4px;color:var(--dd-muted);font-size:12px;font-weight:600;letter-spacing:0;text-transform:none}
:root :is(.menu-sep,.wsw-sep,.col-sep,.wf-pop-sep){display:block;height:1px;margin:6px 4px;padding:0;border:0;background:var(--dd-panel-border)}
:root :is(.menu-pop,.ba-menu,.bar-pop,.colmenu-pop,.pop,.wsw-pop,.run-pop,.sim-menu-pop,.wf-pop,.ctx-menu) > hr{height:1px;margin:6px 4px;border:0;background:var(--dd-panel-border)}
:root :is(.menu-pop,.ba-menu,.colmenu-pop,.pop,.wsw-pop,.run-pop,.sim-menu-pop) form{margin:0}

/* A menu lifted out of a scrolling table or card by the layout's menu
   script (it would be clipped there): fixed to the window, above the page. */
:root .mn-lifted{z-index:var(--z-popover,900)}

/* ---- 4. A search box at the top of a long menu ---- */
:root :is(.mn-search,.col-find,.wf-pop-search){position:relative;flex:none;margin:0 0 6px}
:root .mn-search > svg{position:absolute;left:10px;top:50%;margin-top:-7px;color:var(--dd-placeholder);pointer-events:none}
:root :is(.mn-search,.col-find,.wf-pop-search) input,:root input.wf-pop-search{display:block;box-sizing:border-box;width:100%;height:36px;margin:0;
  border:1px solid var(--dd-border);border-radius:var(--dd-row-radius);background-color:var(--dd-bg);color:var(--dd-text);font:inherit;font-size:14px;box-shadow:none;outline:none}
:root .mn-search input{padding:0 10px 0 32px}
:root :is(.mn-search,.col-find,.wf-pop-search) input:focus,:root input.wf-pop-search:focus{border-color:var(--dd-focus);box-shadow:0 0 0 3px var(--dd-ring)}
:root .mn-empty{margin:0;padding:10px 12px;color:var(--dd-muted);font-size:13px}
:root .mn-empty[hidden],:root [data-menu-search-item].mn-miss{display:none}

/* ---- 5. Filter popovers and the filter panel ---- */
/* The <x-filter-panel> opens under its Filters button as a floating panel
   (public/js/filter-toggle.js adds .is-floating and places it). */
:root .flt-panel{border-color:var(--dd-panel-border);border-radius:var(--dd-panel-radius);background:var(--dd-bg)}
:root .flt-panel.is-floating{position:fixed;z-index:var(--z-dropdown,80);margin:0;width:max-content;max-width:min(560px,calc(100vw - 16px));
  max-height:calc(100vh - 16px);overflow-y:auto;padding:12px;box-shadow:var(--dd-panel-shadow);
  scrollbar-width:thin;scrollbar-color:var(--line-strong,#d0d5dd) transparent;animation:mn-in .14s cubic-bezier(.2,.7,.3,1)}
:root .flt-panel.is-floating{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;gap:8px 10px;width:520px}
:root .flt-panel.is-floating > *{min-width:0}
:root .flt-panel.is-floating > :is(select,input:not([type=hidden])),:root .flt-panel.is-floating input.flt-search{width:100%}
:root .flt-panel.is-floating .flt-f{display:flex;min-width:0}
:root .flt-panel.is-floating .flt-f > :is(select,input,.flt-range,.sui-btn){flex:1 1 auto;width:auto;min-width:0;max-width:none}
:root .flt-panel.is-floating .flt-acts{grid-column:1 / -1;justify-content:flex-end;margin:0;padding-top:4px}
@media (max-width: 560px){
  :root .flt-panel.is-floating{grid-template-columns:minmax(0,1fr)}
}
@keyframes mn-in{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){:root .flt-panel.is-floating{animation:none}}

/* ---- 6. Phones and tablets: the bigger rows of the dropdown ---- */
@media (pointer: coarse){
  :root :is(.mn-search,.col-find) input{height:42px;font-size:16px}
}
