/* A fixed header/footer around one scrolling content area. Native closed dialogs stay hidden. */
html body dialog.hub-dialog{--dialog-bg:#1a1e25;--dialog-field:#101216;--dialog-text:#f4f5f7;--dialog-muted:#b3bac5;--dialog-line:#444b57;box-sizing:border-box;width:min(900px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);height:fit-content;margin:auto;font:14px/1.5 system-ui;padding:0!important;border:1px solid var(--dialog-line);border-radius:12px!important;background:var(--dialog-bg)!important;color:var(--dialog-text)!important;overflow:hidden!important;color-scheme:dark}
html[data-theme=light] body dialog.hub-dialog,html body.light dialog.hub-dialog{--dialog-bg:#fff;--dialog-field:#f5f6f8;--dialog-text:#202630;--dialog-muted:#596475;--dialog-line:#c6ced9;color-scheme:light}
html body dialog.hub-dialog:not([open]){display:none!important}
html body .hub-dialog-layout{display:flex;flex-direction:column;min-height:0;max-height:calc(100dvh - 24px);margin:0}
html body dialog.hub-dialog[open]{display:flex;flex-direction:column}
html body dialog.hub-dialog>.hub-dialog-layout{width:100%;height:auto}
html body .hub-dialog-header{display:block;flex:0 0 auto;padding:20px 24px 14px;background:var(--dialog-bg);border:0;color:var(--dialog-text)}
html body .hub-dialog-header h2,html body .hub-dialog-header b{display:block;margin:0;font-size:20px;line-height:1.3;color:inherit;overflow-wrap:anywhere}
html body .hub-dialog-body{flex:1 1 auto;min-height:0;overflow:auto;padding:8px 24px 24px;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-wrap:anywhere}
html body .hub-dialog-body>form{height:auto;display:block}
html body .hub-dialog-body label{max-width:100%;min-width:0;overflow-wrap:anywhere}
html body .hub-dialog-body label:has(>textarea),html body .hub-dialog-body form>label{display:block;margin:12px 0}
html body .hub-dialog-body input:not([type=checkbox]):not([type=radio]),html body .hub-dialog-body select,html body .hub-dialog-body textarea{box-sizing:border-box;max-width:100%;font:inherit;background:var(--dialog-field)!important;color:var(--dialog-text)!important;border:1px solid var(--dialog-line);border-radius:7px;padding:10px;min-height:40px}
html body .hub-dialog-body form>label>input:not([type=checkbox]):not([type=radio]),html body .hub-dialog-body form>label>select,html body .hub-dialog-body textarea{display:block;width:100%;margin-top:6px}
html body .hub-dialog-body textarea{min-height:8rem!important;resize:vertical}
html body .hub-dialog-body button:not(.hub-dialog-primary):not(.inventory-primary):not(.danger):not(.destructive){background:var(--dialog-bg)!important;color:var(--dialog-text)!important;border-color:var(--dialog-line)}
html body .hub-dialog-body button:not(:disabled):hover{border-color:var(--hub-accent,#ff7482)}
html body .hub-dialog-body [role=status],html body .hub-dialog-body small{color:var(--dialog-muted)}
html body .hub-dialog-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px;padding:16px 24px;border-top:1px solid var(--dialog-line);background:var(--dialog-bg);margin:0;box-sizing:border-box;max-height:50dvh;overflow:auto}
html body .hub-dialog-footer:empty{display:none}
html body .hub-dialog-footer button{box-sizing:border-box;flex:0 1 auto;min-width:0;max-width:100%;min-height:42px;margin:0;padding:10px 14px;border:1px solid var(--dialog-line);border-radius:7px;background:var(--dialog-bg);color:var(--dialog-text);font:inherit;line-height:1.3;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
html body .hub-dialog-footer button:not(:disabled):hover{background:var(--dialog-field);border-color:var(--dialog-muted);color:var(--dialog-text)}
html body .hub-dialog-footer button.hub-dialog-primary{background:var(--hub-accent-fill,#b8192d);border-color:var(--hub-accent-fill,#b8192d);color:#fff}
html body .hub-dialog-footer button.hub-dialog-primary:not(:disabled):hover{background:var(--hub-accent-hover,#d3263c);border-color:var(--hub-accent-hover,#d3263c);color:#fff}
html body .hub-dialog-footer button:disabled{opacity:.5;cursor:default}
html body dialog.hub-dialog :is(button,input,select,textarea):focus-visible{outline:3px solid var(--hub-accent,#ff7482);outline-offset:2px}
html body dialog.hub-dialog::backdrop{background:#080a0ec9}
@media(max-width:600px){html body .hub-dialog-header{padding:16px 16px 12px}html body .hub-dialog-body{padding:4px 16px 16px}html body .hub-dialog-footer{padding:12px 16px;gap:8px}html body .hub-dialog-footer button{flex:1 1 100%}html body .hub-dialog-header h2{font-size:18px}}

/* Shared dialog controls: checkbox size and label alignment match other forms. */
html body .hub-dialog-body label:has(>input:is([type=checkbox],[type=radio])){display:flex;align-items:center;gap:10px;margin:12px 0}
html body .hub-dialog-body input:is([type=checkbox],[type=radio]){box-sizing:border-box;width:18px!important;height:18px!important;min-height:18px!important;min-width:18px!important;max-width:18px!important;flex:0 0 18px;padding:0;margin:0;accent-color:var(--hub-accent-fill,#b8192d)}
html body .hub-dialog-body button{min-height:38px;padding:8px 12px;border-radius:7px;font:inherit;cursor:pointer}
html body .hub-dialog-body button:disabled{opacity:.5;cursor:default}

/* Shared per-session/group correction results in both picker and rides. */
.mychron-bulk-edit{max-width:min(680px,calc(100vw - 32px))}.mychron-bulk-edit form{display:grid;gap:12px}.mychron-bulk-edit label{display:grid;gap:6px}.mychron-bulk-edit select{width:100%;min-height:36px}.mychron-bulk-results [data-outcome=success]{color:var(--hub-success,#68c99a)}.mychron-bulk-results [data-outcome=error]{color:var(--hub-accent,#ff7482)}

/* Analysis settings use the shared header/body contract, including short viewports. */
html body dialog.hub-dialog.hub-dialog-pinned-close{box-sizing:border-box;padding:0!important;max-height:calc(100dvh - 24px)!important;overflow:hidden!important}
html body dialog.hub-dialog.hub-dialog-pinned-close[open]{display:flex;flex-direction:column}
html body .hub-dialog-pinned-close>.hub-dialog-header{display:flex;align-items:center;gap:12px;flex:0 0 auto;padding:16px 20px!important;min-width:0}
html body .hub-dialog-pinned-close>.hub-dialog-header h2{flex:1;min-width:0;margin:0!important;overflow-wrap:anywhere}
html body .hub-dialog-pinned-close>.hub-dialog-header>.hub-dialog-close-control{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;min-height:32px;padding:0!important;margin:0}
html body .hub-dialog-pinned-close>.hub-dialog-body{flex:1 1 auto;min-height:0;overflow:auto;padding:0 20px 20px;overscroll-behavior:contain}
html body .hub-dialog-close-control .hub-icon-label{display:none}
@media(max-width:600px){html body .hub-dialog-pinned-close>.hub-dialog-header{padding:12px!important}html body .hub-dialog-pinned-close>.hub-dialog-body{padding:0 12px 12px}}

html body .hub-dialog-pinned-close>.hub-dialog-toolbar{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0 20px 12px}
@media(max-width:600px){html body .hub-dialog-pinned-close>.hub-dialog-toolbar{padding:0 12px 12px}}
