/* SHINE shared layer contract. Native modal dialogs use the browser top layer.
   Utilities reserve real layout space; a z-index never substitutes for clearance. */
:root{--shine-layer-content:0;--shine-layer-sticky:10;--shine-layer-utility:20;--shine-layer-header:30;--shine-layer-popover:40;--shine-layer-drawer-backdrop:50;--shine-layer-drawer:60;--shine-layer-loading:70;--shine-edge:12px}
body:has(.shell.horizon-shell){padding-bottom:0;overflow:hidden}
.shell.horizon-shell{height:100dvh;min-height:0;overflow:hidden}
.shell.horizon-shell>.shell-main{height:100dvh;min-height:0;overflow:visible}
.shell.horizon-shell .topbar{flex:none;position:relative;z-index:var(--shine-layer-header);overflow:visible}
.shell.horizon-shell .sidebar{z-index:var(--shine-layer-drawer)}
.shell.horizon-shell .overlay{z-index:var(--shine-layer-drawer-backdrop)}
.shell.horizon-shell>.shell-main>.content{position:relative;z-index:var(--shine-layer-content);min-height:0;flex:1 1 auto;overflow:auto;overscroll-behavior:contain;scroll-padding-block:24px;padding-bottom:24px}
.shell.horizon-shell .content .shell-footer{margin:28px 0 0;padding:16px 0;background:transparent;flex-wrap:wrap}
.shell.horizon-shell .content :is(input,select,textarea,button,a,[tabindex]){scroll-margin-block:24px}
.shell.horizon-shell .save-bar{z-index:var(--shine-layer-sticky)}
.shell-utility-rail{position:relative;z-index:var(--shine-layer-utility);flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 10px;padding:8px max(16px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));background:var(--canvas,#f7f9fd);border-top:1px solid color-mix(in srgb,var(--brand-neutral,#dce5ef) 30%,transparent);box-shadow:0 -4px 18px #14213907;overflow:visible}
.shell-upload-region{grid-column:1/-1;min-width:0;max-height:min(180px,26dvh);overflow:auto;overscroll-behavior:contain}
.shell-upload-region:not(:has(.shine-upload-dock:not([hidden]))){display:none}
.shell-upload-region .shine-upload-dock{margin:0 0 7px;max-height:none;overflow:visible}
.shell-upload-region .shine-upload-card{padding:10px 12px;border-radius:12px;box-shadow:none}
.shell-upload-region .shine-upload-bar{margin-top:7px}
.shell-assistance{grid-column:2;display:flex;justify-content:flex-end;align-items:center;min-width:0}
.shell.horizon-shell .assistant-dock{position:static;inset:auto;z-index:auto;max-width:100%;margin:0;gap:0}
.shell.horizon-shell .assistant-launcher{min-height:44px;max-width:100%}
.shell.horizon-shell .shell-utility-rail>.mobile-bottom-nav{position:static;inset:auto;z-index:auto;grid-column:1;grid-row:2;min-height:0;margin:0;padding:0;background:transparent;border:0;box-shadow:none;backdrop-filter:none}
.shell.horizon-shell .shell-utility-rail>.shell-assistance{grid-row:2}
.assistant-panel::backdrop,.help-modal::backdrop{background:#091b3d87;backdrop-filter:blur(5px)}
dialog.assistant-panel{position:fixed;inset:auto max(14px,env(safe-area-inset-right,0px)) max(14px,env(safe-area-inset-bottom,0px)) auto;margin:0;padding:0;width:min(430px,calc(100vw - 28px));max-width:calc(100vw - 28px);height:min(730px,calc(100dvh - 28px));max-height:calc(100dvh - 28px);color:var(--ink,#17233c);background:var(--canvas,#fff)}
dialog.help-modal{position:fixed;inset:0;margin:auto;padding:0;width:min(850px,calc(100vw - 28px));max-width:calc(100vw - 28px);height:auto;max-height:calc(100dvh - 28px);color:var(--ink,#17233c);background:var(--canvas,#fff)}
.assistant-panel>header,.assistant-panel>footer,.help-modal>header,.help-modal>footer{flex:none}
.assistant-panel .assistant-scroll,.help-modal .help-modal-body{min-height:0;overscroll-behavior:contain}
dialog.assistant-panel:not([open]),dialog.help-modal:not([open]){display:none}
[data-brand-mode=dark] .assistant-panel>header,[data-brand-mode=dark] .assistant-panel>footer,[data-brand-mode=dark] .help-modal>header,[data-brand-mode=dark] .help-modal>footer{background:var(--brand-dark);color:var(--ink)}
.name-select-portal{display:contents}
.name-select-portal .name-select-options,.name-select-portal .sub-ui-name-options{position:fixed;z-index:var(--shine-layer-popover);margin:0!important;max-height:none;overscroll-behavior:contain;box-sizing:border-box}
[data-brand-mode=dark] .name-select-options,[data-brand-mode=dark] .sub-ui-name-options{background:var(--canvas);color:var(--ink);border-color:var(--brand-neutral)}
[data-brand-mode=dark] .name-select-options button,[data-brand-mode=dark] .name-select-options strong{color:var(--ink)}
.menu-search-results,.account-popover{z-index:var(--shine-layer-popover);max-height:min(420px,calc(100dvh - 130px));overflow:auto;overscroll-behavior:contain}
.shine-page-loader{z-index:var(--shine-layer-loading)}
.mobile-bottom-nav{z-index:var(--shine-layer-utility)}
body:has(.mobile-bottom-nav) .shine-upload-dock{inset:auto}
@media(max-width:800px){
 .shell-utility-rail{grid-template-columns:minmax(0,1fr) 48px;gap:0 5px;padding:6px max(7px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(7px,env(safe-area-inset-left,0px))}
 .shell.horizon-shell .shell-utility-rail>.mobile-bottom-nav{display:grid;min-height:52px}
 .shell.horizon-shell .assistant-launcher{min-width:44px;width:48px;min-height:52px;display:flex;flex-direction:column;justify-content:center;gap:3px;padding:5px 1px;border-radius:12px;font-size:10px;box-shadow:none}
 .shell.horizon-shell .assistant-launcher>span{font-size:0;line-height:12px}
 .shell.horizon-shell .assistant-launcher>span::after{content:'AI';font-size:10px}
 .shell.horizon-shell .assistant-launcher>svg{width:21px;height:21px}
 .shell.horizon-shell .assistant-launcher>i{right:-2px;top:-3px}
 .shell.horizon-shell .assistant-launcher>.help-spin{position:absolute;right:0;top:0;width:13px;height:13px}
 dialog.assistant-panel,dialog.help-modal{inset:0;margin:auto;width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:18px}
 dialog.assistant-panel{height:calc(100dvh - 20px)}
 .shell-upload-region{max-height:min(148px,24dvh)}
 .shell-upload-region .shine-upload-heading{gap:8px}
 .shell-upload-region .shine-upload-mark{flex-basis:28px;height:28px;border-radius:8px}
 .shell-upload-region .shine-upload-mark img{max-width:25px;max-height:25px}
}
@media print{
 body:has(.shell.horizon-shell){overflow:visible;height:auto}
 .shell.horizon-shell,.shell.horizon-shell>.shell-main{height:auto;min-height:0;overflow:visible;display:block}
 .shell.horizon-shell>.shell-main>.content{height:auto;overflow:visible;display:block;padding:0;max-width:none}
 .shell-utility-rail,.shine-upload-dock{display:none!important}
 .shell.horizon-shell .save-bar{position:static}
}

@media(max-height:500px){.shell-upload-region{max-height:64px}.shell.horizon-shell .content .shell-footer{margin-top:16px}}
