/* One server form wraps each Web Forms page; client-only buttons never post back. */
#MainForm { margin: 0; min-height: 100vh; }
.profile .sign-out-control { margin-left: auto; }
.design-options { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.design-options a { font-size: 10px; padding: 3px 7px; border: 1px solid #9dabc345; border-radius: 5px; }
.design-options a[aria-current="page"] { border-color: currentColor; }

/* ── Right-side drawer ───────────────────────────────────────────────────
   A Bootstrap 4 modal restyled, not a new component: .modal('show'),
   data-dismiss and the backdrop all keep working, and a modal opts in with
   one class on its .modal div (modal-drawer). The width stays the dialog's
   own (max-width, modal-lg). Confirms, alerts and wide work surfaces stay
   centred simply by not opting in.
   "body" on every selector: Site.Master loads this file BEFORE bootstrap.css,
   whose .modal.fade .modal-dialog (translate 0,-50px) would otherwise win on
   order and drop the drawer in from the top instead of sliding it from the right. */
body .modal.modal-drawer .modal-dialog {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    margin: 0;
    min-height: 0;
    display: flex;
    align-items: stretch;
    transform: translateX(100%);
    transition: transform .25s ease-out;
}
body .modal.modal-drawer.show .modal-dialog {
    transform: none;
}
/* The box is whatever sits in .modal-dialog (modal-content, saa-modal, ula-modal, di-modal...):
   full height, header and footer pinned, and its body - any *modal-body class - scrolls, so a
   long form never pushes the Save button below the screen. */
body .modal.modal-drawer .modal-dialog > * {
    height: 100%;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0 !important;
    border-width: 0 0 0 1px;
    box-shadow: -8px 0 32px rgba(0,0,0,0.25) !important;
}
body .modal.modal-drawer .modal-dialog > * > * {
    flex-shrink: 0;
}
body .modal.modal-drawer .modal-dialog > * > [class*="modal-body"] {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Slim grey scrollbar from the theme's --text: dark grey on the light theme, light grey
       on the dark ones (aurora, neon-prism). */
    --drawer-thumb: color-mix(in srgb, var(--text, #808080) 28%, transparent);
    --drawer-thumb-hover: color-mix(in srgb, var(--text, #808080) 45%, transparent);
    scrollbar-width: thin;
    scrollbar-color: var(--drawer-thumb) transparent;
}
/* Chrome 121+ uses scrollbar-color and skips ::-webkit-scrollbar, so the hover shade goes here. */
body .modal.modal-drawer .modal-dialog > * > [class*="modal-body"]:hover {
    --drawer-thumb: color-mix(in srgb, var(--text, #808080) 40%, transparent);
}
body .modal.modal-drawer [class*="modal-body"]::-webkit-scrollbar { width: 8px; }
body .modal.modal-drawer [class*="modal-body"]::-webkit-scrollbar-track { background: transparent; }
body .modal.modal-drawer [class*="modal-body"]::-webkit-scrollbar-thumb {
    background: var(--drawer-thumb);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
body .modal.modal-drawer [class*="modal-body"]::-webkit-scrollbar-thumb:hover {
    background: var(--drawer-thumb-hover);
    background-clip: padding-box;
}
@media (prefers-reduced-motion: reduce) {
    body .modal.modal-drawer .modal-dialog { transition: none; }
}

/* The same right-side drawer for a page's own overlay dialogs (not Bootstrap):
   any "fixed full-screen overlay that centres a flex-column box" - wb-modal,
   sk-modal, bi-modal, mf-overlay. Put ui-drawer on the BOX, not the overlay:
   the overlay still dims the page and still closes on a click beside the box.
   They are shown by toggling display, so the slide is an animation (it replays
   on every show) rather than a transition. */
.ui-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-width: 0 0 0 1px !important;
    box-shadow: -8px 0 32px rgba(0,0,0,0.25) !important;
    display: flex;
    flex-direction: column;
    animation: ui-drawer-in .25s ease-out;
}
@keyframes ui-drawer-in {
    from { transform: translateX(100%); }
    to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ui-drawer { animation: none; }
}

/* ── Change Role modal (#ChangeRoleModal, the same markup on ~27 pages) ───
   Bootstrap's .modal-content is white, so on the dark themes it was a white
   box - and on pages whose text follows the theme, near-white text on white.
   Theme-wide tokens here; TeamAppMaintenance/MaintenanceStyle.css loads after
   this and keeps its own (same-looking) --dt-* version. A page can still give
   the header a colour of its own (SelfDocUpload's blue bar). */
#ChangeRoleModal .modal-content {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
}
#ChangeRoleModal .modal-header { border-bottom-color: var(--line); }
#ChangeRoleModal .close { color: var(--muted); text-shadow: none; opacity: 1; }
#ChangeRoleModal .close:hover { color: var(--text); }
#ChangeRoleModal .leftAlignButton {
    background: color-mix(in srgb, var(--text) 5%, var(--panel));
    border: 1px solid var(--line);
    color: var(--text) !important;
}
#ChangeRoleModal .leftAlignButton:hover { background: color-mix(in srgb, var(--text) 10%, var(--panel)); }
