/* V4 overlay proportions. Reading, forms and brief decisions have distinct shells. */
:root.qd-theme{--qd-workspace-left:0px;--qd-workspace-width:var(--app-region-width,100vw)}
.qd-theme dialog::backdrop{background:#20382f30;backdrop-filter:blur(3px)}
.qd-theme dialog[open]{animation:qd-panel-enter 180ms var(--qd-ease,ease-out)}
.qd-theme :is(.exh-personal-dialog,.exh-identity-dialog,.exh-preferences-dialog,.trade-dialog,.exh-doc-dialog,.exh-entity-dialog,.exh-map-embedded,.ins-dialog,.exh-content-dialog,.exh-record-dialog){background:#fff;color:var(--qd-ink);border:1px solid var(--qd-line);border-radius:22px;box-shadow:0 20px 64px #183e2e20}
.qd-theme.qd-chat-layout .exh-product :is(.exh-personal-dialog,.exh-identity-dialog,.exh-preferences-dialog,.trade-dialog){border-radius:22px!important}
.qd-theme :is(.exh-identity-heading,.exh-preferences-heading,.exh-personal-heading,.trade-dialog>header){padding:12px 20px;min-height:64px;gap:12px;border-bottom:1px solid var(--qd-line);flex:none;box-sizing:border-box}
.qd-theme :is(.exh-identity-heading,.exh-preferences-heading,.exh-personal-heading,.trade-dialog>header) :is(h2,h3){margin:0;font:600 20px/28px var(--qd-font-sans)!important}
.qd-theme :is(.exh-identity-close,.exh-preferences-close,#closePersonalMenu,.trade-dialog-close){display:grid;place-items:center;flex:none;min-width:44px;width:44px;min-height:44px;height:44px;padding:0;margin:0;border:0;border-radius:12px;background:transparent;color:var(--qd-muted);font:24px/1 var(--qd-font-sans)}
.qd-theme :is(.exh-identity-close,.exh-preferences-close,#closePersonalMenu,.trade-dialog-close):hover{background:var(--qd-soft)}
.qd-theme #closePersonalMenu svg{width:20px;height:20px}
/* My is a content-height menu, not an empty full-height drawer. */
.qd-theme .exh-personal-dialog{inset:80px 24px auto auto;width:360px;height:auto;max-height:calc(var(--app-visible-height,100dvh) - 104px);margin:0;padding:0;overflow:hidden}
.qd-theme .exh-personal-dialog .exh-personal-heading{border-bottom:0;padding-bottom:4px}
.qd-theme .exh-personal-heading p{display:none}
.qd-theme .exh-personal-content{display:flex;flex-direction:column;padding:0 20px 16px;min-height:0;overflow:auto}
.qd-theme .exh-personal-content .exh-identity-card.is-compact{display:contents}
.qd-theme .exh-personal-content .exh-identity-state{order:0;font-size:15px;font-weight:500;color:var(--qd-ink);margin:6px 0 2px}
.qd-theme .exh-personal-content .exh-identity-detail{order:1;font-size:12px;line-height:1.65;margin:0 0 14px;color:var(--qd-muted)}
.qd-theme .exh-personal-entries{order:2;display:grid;gap:0;margin:0}
.qd-theme .exh-personal-commerce{gap:0}
.qd-theme .exh-personal-entries :is(.trade-button,.exh-personal-entry){min-height:52px;padding:12px 0;border:0;border-top:1px solid #e7ece7;border-radius:0;background:transparent;box-shadow:none;color:var(--qd-ink);font:400 15px/1.6 var(--qd-font-sans)}
.qd-theme .exh-personal-entries :is(.trade-button,.exh-personal-entry):hover{background:#f5f8f5}
.qd-theme .exh-identity-management{order:3;border-block:1px solid #e7ece7;font-size:15px}
.qd-theme .exh-identity-management summary{display:flex;align-items:center;justify-content:space-between;min-height:52px;list-style:none;cursor:pointer}
.qd-theme .exh-identity-management summary::-webkit-details-marker{display:none}
.qd-theme .exh-identity-management summary::after{content:'›';font-size:20px;color:var(--qd-muted);transform:rotate(0deg);transition:transform 120ms}
.qd-theme .exh-identity-management[open] summary::after{transform:rotate(90deg)}
.qd-theme .exh-identity-management .exh-identity-actions{padding:0 0 12px;gap:8px}
.qd-theme .exh-identity-management button{min-height:44px;font-size:13px;padding:8px 12px;border-radius:12px}
.qd-theme .exh-personal-content .exh-logout{order:4;margin:8px 0 0;padding:10px 0;justify-content:flex-start;gap:8px;color:var(--qd-muted);background:transparent;border:0;font-size:13px}
.qd-theme .exh-logout svg{width:16px;height:16px;margin-left:auto}
/* Both form dialogs hold their heading/actions and scroll only their fields. */
.qd-theme :is(.exh-identity-dialog,.exh-preferences-dialog){width:min(520px,calc(var(--app-region-width,100vw) - 48px));height:auto;max-height:calc(var(--app-visible-height,100dvh) * .82);padding:0;overflow:hidden}
.qd-theme :is(.exh-identity-body,.exh-preferences-body){display:flex;flex-direction:column;min-height:0;max-height:calc(var(--app-visible-height,100dvh) * .82);padding:0;overflow:hidden;width:100%}
.qd-theme :is(.exh-identity-body,.exh-preferences-body)>form{display:flex;flex-direction:column;min-height:0;overflow:hidden;margin:0}
.qd-theme :is(.exh-identity-content,.exh-preferences-scroll){min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px;scrollbar-width:thin}
.qd-theme .exh-preferences-heading{margin:0;display:flex;align-items:center;justify-content:space-between}
.qd-theme .exh-preferences-scroll>p:first-child{margin:0 0 20px;color:var(--qd-muted);font-size:14px;line-height:1.65}
.qd-theme .exh-preferences-dialog fieldset{margin:0;gap:20px 12px}
.qd-theme .exh-preferences-dialog select{min-height:48px;border-radius:12px;border-color:#d5e1d8;background:#fff;padding:10px 12px}
.qd-theme .exh-preferences-dialog fieldset>label:has(input[type=checkbox]){border-color:#dfe7e0;background:#fbfcf9}
.qd-theme .exh-preferences-dialog fieldset>label:has(input:checked){background:var(--qd-soft);border-color:#a8c4b3}
.qd-theme :is(.exh-identity-footer,.exh-preferences-actions){flex:none;padding:14px 20px max(16px,env(safe-area-inset-bottom,0px));border-top:1px solid var(--qd-line);background:#fff;margin:0}
.qd-theme .exh-preferences-actions{display:flex;flex-direction:column;gap:2px}
.qd-theme .exh-preferences-actions button{width:100%;margin:0;border-radius:14px;min-height:48px}
.qd-theme .exh-preferences-actions button+button{min-height:44px;background:transparent;color:var(--qd-muted);font-weight:400}
.qd-theme .exh-preferences-privacy{margin-top:16px;font-size:12px;color:var(--qd-muted)}
.qd-theme .exh-preferences-privacy summary{min-height:44px;align-content:center}
.qd-theme .exh-identity-id-card{background:#f6f9f6;border-color:var(--qd-line);border-radius:14px}
.qd-theme .exh-identity-notice{background:#f8faf7;border-color:#e3eae3}
.qd-theme .exh-identity-footer>.qd-button{border-radius:14px}
/* Short irreversible confirmations use a small centered decision surface. */
.qd-theme .exh-product .exh-dialog{position:fixed;left:var(--qd-workspace-left)!important;right:calc(100vw - var(--qd-workspace-left) - var(--qd-workspace-width))!important;top:var(--app-visible-top,0px)!important;bottom:calc(100dvh - var(--app-visible-top,0px) - var(--app-visible-height,100dvh))!important;margin:auto!important;width:min(420px,calc(var(--app-region-width,100vw) - 48px));max-height:calc(var(--app-visible-height,100dvh) - 32px);padding:0!important;border:1px solid var(--qd-line);border-radius:22px!important;box-shadow:0 18px 60px #183e2e20;background:#fff;overflow:hidden}
.qd-theme .exh-dialog-scroll{padding:24px}
.qd-theme .exh-dialog h2{margin:0 0 12px;font:600 20px/28px var(--qd-font-sans)!important}
.qd-theme .exh-dialog p{margin:0;color:var(--qd-muted);font-size:14px;line-height:1.65}
.qd-theme .exh-dialog-icon{display:none}
.qd-theme .exh-dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding-top:24px}
.qd-theme .exh-dialog-actions button{min-height:46px;padding:10px 12px;border-radius:14px;font-size:14px}
.qd-theme #confirmDelete{background:#a45b48;color:#fff}
.qd-theme .exh-dialog-error:not([hidden]){margin-top:12px;padding:10px}
/* Desktop reading and editing align with the visible workspace. */
@media(min-width:768px){
 .qd-theme :is(.exh-dialog,.exh-identity-dialog,.exh-preferences-dialog,.exh-doc-dialog,.exh-entity-dialog,.exh-map-embedded,.trade-dialog,.ins-dialog,.exh-content-dialog,.exh-record-dialog)[open]{left:var(--qd-workspace-left);right:0;margin-inline:auto;max-width:calc(var(--qd-workspace-width) - 48px)}
 .qd-theme :is(.exh-doc-dialog,.exh-entity-dialog){width:min(760px,calc(var(--qd-workspace-width) - 64px));max-height:calc(var(--app-visible-height,100dvh) - 64px)}
 .qd-theme:is(.qd-admin-layout,.qd-responsive-layout) dialog[open]{left:var(--qd-workspace-left);right:0;margin-inline:auto;box-sizing:border-box;max-width:calc(var(--qd-workspace-width) - 48px)!important}
 .qd-theme:is(.qd-admin-layout,.qd-responsive-layout) :is(.account-dialog,.collab-dialog,.vm-dialog){width:min(560px,calc(var(--qd-workspace-width) - 48px));border-radius:22px}
}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) mdui-dialog[open]{width:auto!important;max-width:none!important;height:auto;max-height:none!important;inset:0!important;margin:0!important;border:0!important;border-radius:0!important;background:#20382f30!important;box-shadow:none!important;backdrop-filter:blur(3px);padding:24px 24px 24px calc(var(--qd-workspace-left) + 24px);align-items:center;justify-content:center}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) mdui-dialog .aui-dialog__panel{width:min(560px,100%);max-height:calc(var(--app-visible-height,100dvh) - 48px)!important;gap:16px;padding:24px;border:1px solid var(--qd-line);border-radius:22px;box-shadow:0 20px 64px #183e2e20;background:#fff;overscroll-behavior:contain}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) mdui-dialog .aui-dialog__title{font:600 20px/28px var(--qd-font-sans)}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) :is(.modal-header,.aui-dialog__header){min-height:40px;padding:0 0 12px;align-items:center;border-bottom:1px solid var(--qd-line)}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) :is(.modal-header,.aui-dialog__header) :is(h2,h3,h4,h5){font:600 20px/28px var(--qd-font-sans);margin:0}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .modal-body{padding:4px 0;min-height:0}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .modal-footer{min-height:56px;gap:10px;padding:12px 0 0;border-top:1px solid var(--qd-line)}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) :is(.modal-footer,.aui-dialog__actions) :is(button,mdui-button){min-height:44px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .account-dialog__header{padding:12px 24px;min-height:64px;align-items:center;gap:12px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .account-dialog__header h2{font-size:20px;line-height:28px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .account-dialog__header p{margin:4px 0 0;font-size:13px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .account-dialog__close{width:44px;height:44px;border:0;border-radius:12px;background:transparent;color:var(--qd-muted);font-size:24px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) :is(.account-dialog__header,.account-form__foot){border-radius:0!important}
.qd-theme :is(.account-dialog__close,.exh-identity-close,.exh-preferences-close,#closePersonalMenu):focus-visible{outline-offset:-4px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .account-dialog__body{padding:24px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .account-form__columns{grid-template-columns:minmax(0,1fr);gap:24px}
.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) .account-dialog .account-form__foot{padding:14px 24px;min-height:72px;background:#fff}
@media(max-width:767px){
 .qd-theme .exh-product #personalMenuDialog,.qd-theme .exh-product :is(.exh-identity-dialog,.exh-preferences-dialog){inset:auto auto 0 var(--app-region-left,0px);width:var(--app-region-width,100vw);max-width:var(--app-region-width,100vw)!important;max-height:calc(var(--app-visible-height,100dvh) * .82)!important;margin:0;border-radius:26px 26px 0 0;border-width:1px 0 0}
 .qd-theme .exh-product #personalMenuDialog{padding-bottom:env(safe-area-inset-bottom,0px)}
 .qd-theme.qd-chat-layout .exh-product :is(.exh-personal-dialog,.exh-identity-dialog,.exh-preferences-dialog){border-radius:26px 26px 0 0!important}
 .qd-theme .exh-product .exh-preferences-dialog fieldset{grid-template-columns:repeat(2,minmax(0,1fr))}
 .qd-theme .exh-product .exh-preferences-dialog fieldset>label:not(:has(input[type=checkbox])){grid-column:1/-1}
 .qd-theme .exh-product .exh-preferences-dialog select{font-size:16px}
 .qd-theme:is(.qd-admin-layout,.qd-responsive-layout) mdui-dialog[open]{padding:16px;backdrop-filter:blur(2px)}
 .qd-theme:is(.qd-admin-layout,.qd-responsive-layout) mdui-dialog .aui-dialog__panel{padding:20px;max-height:calc(var(--app-visible-height,100dvh) - 32px)!important;border-radius:20px}
}
.app-compact-layout.qd-theme .exh-product :is(.exh-doc-dialog,.exh-entity-dialog,.exh-map-embedded){width:var(--app-region-width,100vw)!important;height:var(--app-visible-height,100dvh)!important;max-width:none!important;max-height:none!important;inset:var(--app-visible-top,0px) auto auto var(--app-region-left,0px)!important;margin:0!important;border:0;border-radius:0!important}
.app-segmented.qd-theme .exh-product :is(.exh-identity-dialog,.exh-preferences-dialog){top:auto!important;bottom:calc(100dvh - var(--app-visible-top) - var(--app-visible-height))!important;left:var(--app-region-left)!important;width:var(--app-region-width)!important;max-width:var(--app-region-width)!important;max-height:calc(var(--app-visible-height) * .82)!important}
.app-keyboard-open.qd-theme .exh-product :is(.exh-identity-dialog,.exh-preferences-dialog){top:auto!important;bottom:calc(100dvh - var(--app-visible-top) - var(--app-visible-height))!important;max-height:calc(var(--app-visible-height) - 16px)!important}
.app-keyboard-open.qd-theme :is(.exh-identity-body,.exh-preferences-body){max-height:calc(var(--app-visible-height) - 16px)}
.app-keyboard-open.qd-theme dialog[open]{animation:none!important}
.app-compact-layout.qd-theme:is(.qd-admin-layout,.qd-responsive-layout) mdui-dialog[open]{padding:16px;left:var(--app-region-left,0px)!important;top:var(--app-visible-top,0px)!important;right:auto!important;bottom:auto!important;width:var(--app-region-width,100vw)!important;height:var(--app-visible-height,100dvh)!important;max-width:none!important;max-height:none!important}
@keyframes qd-panel-enter{from{opacity:.5;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.qd-theme dialog[open]{animation:none!important}}
