/* Shared ToolKnit chooser, based on Compress Image's target-unit control. */
:root{--tk-choice-bg:#1b1b1b;--tk-choice-text:#fff;--tk-choice-line:rgba(255,255,255,.14);--tk-choice-hover:rgba(255,255,255,.075);--tk-choice-selected:rgba(255,255,255,.11);--tk-choice-muted:#aaa;--tk-choice-shadow:0 14px 34px rgba(0,0,0,.5)}
html.light-mode{--tk-choice-bg:#f5f5f5;--tk-choice-text:#171717;--tk-choice-line:rgba(0,0,0,.16);--tk-choice-hover:rgba(0,0,0,.06);--tk-choice-selected:rgba(0,0,0,.1);--tk-choice-muted:#626262;--tk-choice-shadow:0 14px 34px rgba(0,0,0,.16)}
html select{color-scheme:dark}html select option,html select optgroup{background:var(--tk-choice-bg);color:var(--tk-choice-text)}html.light-mode select{color-scheme:light}
/* The original select retains its value, layout, form and label associations.
   JS intercepts opening only; the option panel is drawn by ToolKnit. */
select.tk-select{appearance:none!important;-webkit-appearance:none!important;box-sizing:border-box;max-width:100%;padding-right:36px!important;border:1px solid var(--tk-choice-line)!important;border-radius:10px!important;background-color:var(--tk-choice-bg)!important;color:var(--tk-choice-text)!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 12px center!important;background-size:14px!important;cursor:pointer;transition:border-color .18s,box-shadow .18s,background-color .18s;color-scheme:dark}
select.tk-select:hover:not(:disabled){border-color:#707070!important}
select.tk-select:focus-visible{outline:2px solid #999!important;outline-offset:2px}
select.tk-select[aria-expanded="true"]{border-color:#777!important;box-shadow:0 0 0 3px rgba(128,128,128,.08);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E")!important}
select.tk-select:disabled{cursor:not-allowed;opacity:.45}
select.tk-select option,select.tk-select optgroup{background:var(--tk-choice-bg);color:var(--tk-choice-text)}
html.light-mode select.tk-select{color-scheme:light}
.tk-select-menu{position:fixed;inset:auto;margin:0;box-sizing:border-box;padding:5px;border:1px solid var(--tk-choice-line);border-radius:10px;background:var(--tk-choice-bg);color:var(--tk-choice-text);box-shadow:var(--tk-choice-shadow);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#666 transparent;z-index:2147483000;max-height:280px;opacity:0;transform:translateY(-4px) scale(.985);transform-origin:top center;transition:opacity .18s ease,transform .18s ease;pointer-events:none;line-height:1.45;isolation:isolate}
.tk-select-menu[data-side="up"]{transform:translateY(4px) scale(.985);transform-origin:bottom center}
.tk-select-menu.tk-select-open{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}
.tk-select-menu[hidden]{display:none!important}
.tk-select-menu::backdrop{background:transparent;pointer-events:none}
.tk-select-option{display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;min-height:36px;padding:8px 10px;border-radius:7px;font-size:13px;font-weight:500;color:var(--tk-choice-text);cursor:pointer;overflow-wrap:anywhere;transition:background-color .14s,color .14s}
.tk-select-option+.tk-select-option{margin-top:2px}
.tk-select-option[aria-selected="true"]{background:var(--tk-choice-selected);font-weight:650}
.tk-select-option.tk-select-active{background:var(--tk-choice-hover);outline:1px solid var(--tk-choice-line);outline-offset:-1px}
.tk-select-option[aria-disabled="true"]{opacity:.38;cursor:not-allowed}
.tk-select-option-mark{flex:0 0 14px;text-align:center;opacity:0;font-size:12px}
.tk-select-option[aria-selected="true"] .tk-select-option-mark{opacity:1}
.tk-select-group{padding:8px 10px 5px;color:var(--tk-choice-muted);font-size:11px;font-weight:700}
/* Navigation and action menus keep links/buttons and share only the surface. */
html body .tn-lang-menu,html body .detail-dropdown{background:var(--tk-choice-bg);border:1px solid var(--tk-choice-line);border-radius:10px;padding:5px;box-shadow:var(--tk-choice-shadow);color:var(--tk-choice-text)}
html body .tn-lang-menu [data-lang],html body .detail-dropdown button{border-radius:7px;color:var(--tk-choice-text);min-height:36px;transition:background-color .14s,color .14s}
html body .tn-lang-menu [data-lang]:hover,html body .detail-dropdown button:hover{background:var(--tk-choice-hover)}
html body .tn-lang-menu [data-lang].on{background:var(--tk-choice-selected)}
html body .detail-dropdown{display:block;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-4px);transition:opacity .18s,transform .18s,visibility 0s linear .18s}
html body .detail-dropdown.open{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);transition:opacity .18s,transform .18s}
html body .detail-dropdown button.danger{color:#ff9191}
@media(pointer:coarse){.tk-select-option{min-height:44px}}
@media(prefers-reduced-motion:reduce){select.tk-select,.tk-select-menu,.tk-select-option,html body .tn-lang-menu,html body .detail-dropdown{transition:none!important;transform:none!important}}
@media(forced-colors:active){select.tk-select,.tk-select-menu{border:1px solid ButtonText!important;color:ButtonText!important;background:Canvas!important}.tk-select-option.tk-select-active{outline:2px solid Highlight}.tk-select-option[aria-selected="true"]{outline:1px solid ButtonText}}
