/* Web controls follow sonora-main/crates/ui: 36px fields, 32px menu rows,
   6px rounding and neutral popovers. No JavaScript hydration is required. */
:root{
  --control-height:36px;--control-radius:6px;
  --control-bg:var(--background,var(--bg));--control-fg:var(--foreground,var(--fg));
  --control-muted:var(--muted,var(--muted-fg));--control-hover:var(--hover,var(--secondary-hover));
  --control-selected:var(--selected,var(--secondary-active));--control-popover:var(--popover,#fff);
}
:root[data-theme=dark]{--control-popover:var(--popover,#141414)}
select{
  appearance:none;box-sizing:border-box;min-width:0;min-height:var(--control-height);
  border:1px solid var(--border);border-radius:var(--control-radius);
  padding:8px 36px 8px 12px;line-height:20px;
  color:var(--control-fg);background:var(--control-bg) url("/assets/chevron-down.svg?v=15a4018d317aafa8") right 12px center/12px no-repeat;
  cursor:pointer;transition:border-color .14s ease,background-color .14s ease;
}
select:hover{border-color:var(--control-muted)}
select:focus-visible{outline:2px solid var(--control-fg);outline-offset:2px}
select:disabled{opacity:.5;cursor:default}
@supports (appearance:base-select){
  select,select::picker(select){appearance:base-select}
  select{display:flex;align-items:center;justify-content:space-between;gap:12px;background-image:none;padding:7px 12px}
  select::picker-icon{content:"";flex:none;width:12px;height:12px;background:currentColor;mask:url("/assets/chevron-down.svg?v=15a4018d317aafa8") center/contain no-repeat}
  select::picker(select){
    padding:4px;margin-block:6px;border:1px solid var(--border);border-radius:var(--control-radius);
    background:var(--control-popover);color:var(--control-fg);
    box-shadow:0 4px 16px #00000014;font:inherit;min-width:anchor-size(width);
    max-width:calc(100vw - 24px);max-height:min(320px,50dvh);overflow:auto;
  }
  select option{display:flex;align-items:center;gap:8px;min-height:32px;padding:6px 8px;border-radius:3px;line-height:20px;white-space:normal;overflow-wrap:anywhere}
  select option:checked{background:var(--control-selected);font-weight:400}
  select option:hover,select option:focus-visible{background:var(--control-hover);outline:0}
  select option::checkmark{order:1;margin-left:auto;width:16px;font-size:12px}
  select option:disabled{opacity:.5}
}
/* Theme choices use the client's OptionCard dimensions and miniature geometry. */
[data-theme-picker]{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:36px;min-height:36px;padding:8px;border:0;border-radius:6px;background:transparent;color:var(--control-muted);cursor:pointer}
[data-theme-picker]:hover{background:var(--control-hover);color:var(--control-fg)}
[data-theme-picker] svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
dialog.theme-dialog{box-sizing:border-box;width:540px;max-width:calc(100% - 32px);max-height:calc(100dvh - 32px);margin:auto;padding:24px;border:1px solid var(--border);border-radius:6px;background:var(--control-popover);color:var(--control-fg);font:inherit;overflow:auto;scrollbar-gutter:auto}
dialog.theme-dialog::backdrop{background:#0006;backdrop-filter:none}
.theme-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px}
.theme-dialog h2{margin:0;font-size:16px;font-weight:600;line-height:24px}
.theme-dialog [data-theme-close]{display:grid;place-items:center;min-height:32px;width:32px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--control-muted)}
.theme-dialog [data-theme-close]:hover{background:var(--control-hover)}
.theme-dialog [data-theme-close] svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}
.theme-card-rail{display:flex;gap:16px;overflow:auto;padding:8px 4px;scroll-padding:8px;overscroll-behavior:contain}
.theme-dialog .theme-option{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;gap:12px;flex:none;width:150px;min-height:0;padding:0 0 4px;border:0;border-radius:6px;background:transparent;color:var(--control-muted);font:inherit;font-size:13px;line-height:20px;white-space:nowrap;cursor:pointer}
.theme-thumbnail{box-sizing:border-box;display:block;flex:none;width:150px;height:96px;border:1px solid var(--border);border-radius:6px;opacity:.8;transition:opacity .14s ease,border-color .14s ease}
.theme-thumbnail svg{display:block;width:148px;height:94px;border-radius:5px}
.theme-option:hover .theme-thumbnail{opacity:1;border-color:var(--control-muted)}
.theme-option[aria-pressed=true]{color:var(--control-fg)}
.theme-option[aria-pressed=true] .theme-thumbnail{opacity:1;outline:2px solid var(--control-fg);outline-offset:2px}
.theme-option:focus-visible,[data-theme-picker]:focus-visible,[data-theme-close]:focus-visible{outline:2px solid var(--control-fg);outline-offset:4px}
@media(max-width:560px){
  .theme-card-rail{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .theme-dialog .theme-option{width:100%;min-width:0;font-size:12px}
  .theme-dialog .theme-thumbnail{width:100%;height:auto;aspect-ratio:150/96}
  .theme-dialog .theme-thumbnail svg{width:100%;height:100%}
}
.settings-row select{
  --control-bg:var(--app-bg);--control-fg:var(--app-fg);--control-muted:var(--app-muted);
  --control-popover:var(--app-bg);--control-hover:var(--app-selected);--control-selected:var(--app-selected);
  --border:var(--app-line);--control-radius:6px;
  min-height:36px;padding:7px 12px;font-size:12px;min-width:104px;max-width:48%;
}
@media(prefers-reduced-motion:reduce){select,.theme-thumbnail{transition:none}}
