/* Every rule is gated by the shared appearance selection. Classic continues
 * using the original master markup, theme and AjaxControlToolkit behavior. */
html[data-tk-preferences-appearance="modern"] .modalPopup_pref {
 box-sizing:border-box; width:560px; max-width:calc(100vw - 32px);
 max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px);
 overflow:auto; padding:0; border:1px solid #cbdbe8; border-radius:16px;
 background:#fff; color:#203247; box-shadow:0 24px 70px #172d4340;
 font:14px/1.5 Arial,Helvetica,sans-serif;
}
/* The existing sign-in popup also handles expired and manually locked sessions.
 * Keep its controls, visibility and toolkit positioning; change presentation only. */
html[data-tk-preferences-appearance="modern"] .tk-session-dialog {
 box-sizing:border-box; width:480px; max-width:calc(100vw - 32px);
 max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px);
 overflow:auto; padding:0; border:1px solid #cbdbe8; border-radius:16px;
 background:#fff; color:#203247; box-shadow:0 24px 70px #172d4340;
 font:14px/1.5 Arial,Helvetica,sans-serif;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog * { box-sizing:border-box; }
html[data-tk-preferences-appearance="modern"] .tk-session-backdrop { background:#172d43; opacity:.48; filter:none; }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .popup_Titlebar {
 position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between;
 gap:16px; width:100%; height:auto; min-height:76px; margin:0; padding:20px 24px;
 border:0; border-bottom:1px solid #dce6ef; border-radius:0; background:#f4f8fc;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .TitlebarLeft {
 float:none; padding:0; color:#203a50; font:700 23px/1.3 Arial,Helvetica,sans-serif;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .TitlebarRight {
 position:relative; float:none; flex:0 0 32px; width:32px; height:32px; margin:0; padding:0;
 border:1px solid #cfdeea; border-radius:8px; background:#fff; cursor:pointer;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .TitlebarRight::before,
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .TitlebarRight::after {
 content:''; position:absolute; top:14px; left:8px; width:14px; height:2px; background:#47647a; transform:rotate(45deg);
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .TitlebarRight::after { transform:rotate(-45deg); }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .TitlebarRight:hover { background:#e8f1f8; }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog > div:not(.popup_Titlebar) {
 float:none !important; width:auto; margin:0 !important; padding:0 24px 20px;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog > div:nth-child(2) { padding-top:20px; padding-bottom:8px; }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog table {
 width:100%; margin:0 !important; padding:0 !important; border-collapse:collapse; border-spacing:0;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog td { padding:0; vertical-align:middle; }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .popupcaption {
 margin:0; padding:0 !important; color:#5b7082; font:14px/1.6 Arial,Helvetica,sans-serif !important;
 overflow-wrap:anywhere;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .popuplabel {
 display:inline-block; margin:12px 0 6px; color:#405970; font:600 14px/1.4 Arial,Helvetica,sans-serif;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .popupfield {
 display:block; width:100% !important; min-width:0; min-height:44px; margin:0; padding:10px 12px;
 border:1px solid #b8ccdd; border-radius:8px; background:#fff; color:#243b50; font:14px/1.4 Arial,Helvetica,sans-serif;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog a { color:var(--tk-home-accent,#176693); }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .popup_Buttons {
 display:flex; flex-wrap:wrap; gap:10px; margin:18px 0 0 !important; padding:0;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .form_button {
 flex:1 1 150px; width:auto !important; min-height:44px; margin:0; padding:10px 18px;
 border:1px solid #bacedd; border-radius:9px; background:#fff; color:#294c68;
 font:600 14px/1.4 Arial,Helvetica,sans-serif; cursor:pointer;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog [id$="btnOkay"] {
 border-color:var(--tk-home-accent,#176693); background:var(--tk-home-accent,#176693); color:var(--tk-home-on-accent,#fff);
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .form_button:hover { filter:brightness(.96); }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog .form_button:disabled { opacity:.6; cursor:wait; }
html[data-tk-preferences-appearance="modern"] .tk-session-dialog :is(input,a):focus-visible {
 outline:3px solid var(--tk-home-accent,#305d80); outline-offset:2px;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog [id$="googleLoginButton"] {
 display:block; width:210px !important; max-width:100%; height:auto; margin:0 auto;
}
html[data-tk-preferences-appearance="modern"] .tk-session-dialog > br { display:none; }
@media(max-width:520px) {
 html[data-tk-preferences-appearance="modern"] .tk-session-dialog .popup_Titlebar { min-height:64px; padding:16px 18px; }
 html[data-tk-preferences-appearance="modern"] .tk-session-dialog > div:not(.popup_Titlebar) { padding-left:18px; padding-right:18px; }
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref * { box-sizing:border-box; }
html[data-tk-preferences-appearance="modern"] .tk-preferences-backdrop { background:#172d43; opacity:.48; filter:none; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .popup_Titlebar {
 position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between;
 gap:16px; width:100%; height:auto; min-height:76px; margin:0; padding:20px 24px;
 border:0; border-bottom:1px solid #dce6ef; border-radius:0; background:#f4f8fc;
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .TitlebarLeft {
 float:none; padding:0; color:#203a50; font:700 23px/1.3 Arial,Helvetica,sans-serif;
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .TitlebarRight {
 position:relative; float:none; flex:0 0 32px; width:32px; height:32px; margin:0; padding:0;
 border:1px solid #cfdeea; border-radius:8px; background:#fff; cursor:pointer;
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .TitlebarRight::before,
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .TitlebarRight::after {
 content:''; position:absolute; top:14px; left:8px; width:14px; height:2px; background:#47647a; transform:rotate(45deg);
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .TitlebarRight::after { transform:rotate(-45deg); }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .TitlebarRight:hover { background:#e8f1f8; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref > div:not(.popup_Titlebar):not(.popup_Buttons) { padding:20px 24px 24px; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref table { width:100%; padding:0 !important; border-collapse:collapse; border-spacing:0; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .popupcaption {
 margin:0 0 20px; padding:0 !important; color:#5b7082; font:14px/1.6 Arial,Helvetica,sans-serif !important;
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref h3 { margin:0 0 16px; padding:0 0 12px; border-bottom:1px solid #e2eaf1; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref h3 .field_label { color:#29475e; font:600 16px/1.5 Arial,Helvetica,sans-serif; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref td { padding:0; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] td { padding:7px 0; vertical-align:middle; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] td:first-child { width:38%; padding-right:16px; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .field_label { color:#405970; font:600 14px/1.4 Arial,Helvetica,sans-serif; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .field_field {
 display:block; width:100%; max-width:100%; min-width:0; min-height:42px; margin:0; padding:9px 12px;
 border:1px solid #b8ccdd; border-radius:8px; background-color:#fff; color:#243b50; font:14px/1.4 Arial,Helvetica,sans-serif;
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref select.field_field { text-overflow:ellipsis; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .field_field:focus-visible,
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .form_button:focus-visible { outline:3px solid #305d80; outline-offset:2px; }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .popup_Buttons {
 position:sticky; bottom:0; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin:0; padding:18px 24px;
 border-top:1px solid #dce6ef; background:#f7fafd;
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .form_button {
 min-height:42px; margin:0; padding:10px 18px; border:1px solid #bacedd; border-radius:9px;
 background:#fff; color:#294c68; font:600 14px/1.4 Arial,Helvetica,sans-serif; cursor:pointer;
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="spButton"] {
 order:1; border-color:var(--tk-home-accent,#176693); background:var(--tk-home-accent,#176693); color:var(--tk-home-on-accent,#fff);
}
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .form_button:hover { filter:brightness(.96); }
html[data-tk-preferences-appearance="modern"] .modalPopup_pref .form_button:disabled { opacity:.6; cursor:wait; }
@media(max-width:520px) {
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref .popup_Titlebar { min-height:64px; padding:16px 18px; }
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref > div:not(.popup_Titlebar):not(.popup_Buttons) { padding:18px; }
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] table,
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] tbody,
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] tr,
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] td { display:block; width:100%; }
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] td:first-child { width:100%; padding:8px 0 4px; }
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref [id$="PreferenceFormPanel"] td:last-child { padding:0 0 8px; }
 html[data-tk-preferences-appearance="modern"] .modalPopup_pref .popup_Buttons { padding:16px 18px; }
}
