/* UIFIX08: final LIVE06 Fusion constants, shell and native-dialog adaptation.
   Operational surface selectors remain more specific than shared button defaults.
   UIFIX09 bundles the original Manrope font and license on the same server. */
:root{--brand:#6955dc;--accent-source:#6955dc;--ink:#282738;--muted:#62697d;--subtle:#747d90;--line:#e0e2ed;--bg:#f7f8fc;--surface:#fff;--surface-2:#f4f5fa;--radius:17px;--btn-radius:11px;--shadow:none;--nav:244px;--top:72px;--stage:36px;--review:var(--stage);--primary-bg:var(--primary);--primary-hover:var(--primary);font-family:Manrope,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.u5-surface{--radius:17px;--btn-radius:11px;--surface-2:#f4f5fa;--ink:#282738;--muted:#62697d;--subtle:#747d90;--line:#e0e2ed}
.btn{min-height:42px;padding:10px 14px;border-radius:var(--btn-radius);border:1px solid var(--line);background:var(--surface);box-shadow:none;color:var(--ink);font-size:12px;font-weight:650;line-height:1.25;letter-spacing:-.1px}
.btn.primary{background:var(--primary-bg);color:#fff;border-color:transparent;border-top-color:#ffffff26;box-shadow:0 5px 12px var(--accent-glow),inset 0 1px 0 #ffffff22}
.btn.soft{background:var(--accent-soft);color:var(--accent-dark);border-color:var(--accent-edge)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted);box-shadow:none}
.btn.danger{background:var(--danger-soft);color:var(--danger);border-color:transparent}
.btn.success{background:#27785e;color:#fff;border-color:transparent}
.icon-btn{border-radius:var(--btn-radius);color:var(--muted)}
.field input,.field select,.field textarea,.search-input{background:var(--surface);border-color:var(--line);color:var(--ink)}
@media(hover:hover){.btn.primary:hover:not(:disabled){background:var(--primary-hover);box-shadow:0 7px 15px var(--accent-glow)}}
.u8-shell .sidebar{background:var(--surface);z-index:45}
.u8-shell .brand{padding:0;gap:10px}
.u8-shell .brand-title{font-size:16px;letter-spacing:-.75px;color:var(--ink)}
.u8-shell .brand-sub{font-size:10px;color:var(--muted)}
.u8-shell .brand-mark{width:36px;height:36px;border-radius:11px;background:var(--primary-bg);color:#fff;box-shadow:0 5px 12px var(--accent-glow),inset 0 1px 0 #ffffff22}
.u8-shell .event-box{width:auto;text-align:left;border-radius:12px;background:var(--surface);box-shadow:inset 3px 0 0 var(--brand);min-height:68px}
.u8-shell .event-initial{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-dark);font-size:14px;flex:none}
.u8-shell .event-box .grow{min-width:0}
.u8-shell .event-box strong{font-size:12px;display:block;overflow-wrap:anywhere}
.u8-shell .event-box small{font-size:10px;color:var(--muted)}
.u8-shell .nav-item,.u8-more .nav-item{display:flex;align-items:center;gap:11px;min-height:43px;border:0;border-radius:10px;padding:10px 12px;width:100%;font-size:12px;font-weight:550;margin-bottom:3px;text-align:left;color:var(--muted);background:transparent}
.u8-shell .nav-item.active,.u8-more .nav-item.active{color:var(--accent-dark);background:var(--accent-soft);font-weight:650;box-shadow:inset 2px 0 0 var(--brand)}
.u8-shell .nav-item:hover,.u8-more .nav-item:hover{background:var(--accent-soft)}
.u8-shell .nav-item .icon,.u8-more .nav-item .icon{width:18px;height:18px;flex:none}
.u8-shell .nav-group,.u8-more .nav-group,.u8-quick-add .nav-group{padding:0 9px;margin:14px 0 7px;font-size:9px;text-transform:uppercase;font-weight:750;letter-spacing:1.2px;color:#959bac}
.u8-shell .appearance-shortcut{display:flex;align-items:center;gap:8px;width:100%;padding:8px 0 12px;font-size:11px;color:var(--muted);background:transparent;border:0;text-align:left}
.u8-shell .appearance-shortcut .icon{width:15px;height:15px;flex:none}
.u8-shell .account-trigger small{font-size:12px;line-height:1.35;margin-top:2px}
.u8-shell .avatar{width:32px;height:32px;border-radius:50%;background:var(--av,#ece8fc);color:var(--avc,#7260ac);border:2px solid white;font-size:11px}
.u8-shell .topbar{background:var(--surface);border-top:2px solid var(--brand);border-bottom-color:var(--line);z-index:35;backdrop-filter:none}
.u8-shell .desktop-crumb{display:block}
.u8-shell .crumb strong{font-size:12px;font-weight:600}
.u8-shell .top-actions{gap:12px}
.u8-shell .search-trigger{display:flex;align-items:center;gap:8px;min-height:38px;font-size:11px;color:var(--muted);border:0;background:transparent;box-shadow:none;padding:0}
.u8-shell .keycap{font-size:10px;border:1px solid var(--line);padding:2px 5px;border-radius:4px;color:var(--subtle)}
.u8-shell .mobile-event-context{display:none}
.u8-shell .main{padding-top:calc(var(--stage) + var(--top) + 30px)}
.u8-sep{height:1px;background:var(--line);margin:18px 0}
.u8-more .btn.wide{justify-content:flex-start;margin-top:3px}
/* Native top layer supplies focus/inert/Escape behavior. Forms live INSIDE content;
   unlike the HTML prototype, they must not become overflow:hidden flex wrappers. */
.u8-dialog{width:min(590px,calc(100% - 36px));max-width:none;max-height:calc(100dvh - 60px);inset:0;margin:auto;padding:0;border:1px solid var(--line);border-radius:23px;background:var(--surface);box-shadow:0 24px 100px #1b17402b;color:var(--ink)}
.u8-dialog.wide{width:min(840px,calc(100% - 36px))}
.u8-dialog:not([open]){display:none}
.u8-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.u8-dialog::backdrop{background:rgba(33,39,62,.34);backdrop-filter:blur(6px)}
.u8-dialog .dialog-head{padding:20px 23px;gap:12px;background:var(--surface);flex:none}
.u8-dialog .dialog-head h2{font-size:19px;letter-spacing:-.5px;line-height:1.35}
.u8-dialog .dialog-head .dialog-subtitle{font-size:11px;color:var(--muted);margin-top:4px}
/* Content must contribute its natural height to an auto-height dialog before
   max-height shrinks the scroll area. A zero flex basis can collapse it in Safari. */
.u8-dialog .dialog-content{padding:21px 23px;min-height:0;flex:1 1 auto;overflow:auto;overscroll-behavior:contain}
.u8-dialog .dialog-actions{padding:14px 23px;gap:9px;flex:none;background:var(--surface);flex-wrap:wrap}
.u8-dialog .dialog-actions .btn{min-height:42px;min-width:0;white-space:normal}
.u8-dialog .form-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.u8-dialog .field{min-width:0}
.u8-dialog .quick-row{display:flex;align-items:center;gap:14px;width:100%;border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:11px;text-align:left;background:var(--surface)}
.u8-dialog .quick-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-dark);flex:none}
.u8-dialog .quick-row>.grow{min-width:0}
.u8-dialog .quick-row strong{display:block;font-size:13px;overflow-wrap:anywhere}
.u8-dialog .quick-row small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.u8-profile .profile-identity{display:flex;align-items:center;gap:11px;padding:0;border:0;margin:0;background:none}
.u8-profile .profile-identity .avatar{width:36px;height:36px;font-size:12px;border-radius:50%}
.u8-profile .profile-identity strong{display:block;font-size:12px}
.u8-profile .profile-identity small{display:block;font-size:11px;color:var(--muted)}
.u8-profile .density-block{padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);margin:18px 0;min-width:0}
.u8-profile .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.u8-profile .density-title{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:650}
.u8-profile .density-title .icon{width:17px;height:17px}
.u8-profile .density-block p{font-size:11px;color:var(--muted);margin:6px 0 12px;line-height:1.6}
.u8-profile .density-choices{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px}
.u8-profile .density-option{display:flex;flex-direction:column;gap:6px;padding:13px;border:1px solid var(--line);background:var(--surface);border-radius:9px;min-width:0}
.u8-profile .density-option:has(input:checked){border-color:var(--accent);box-shadow:0 0 0 1px var(--accent);color:var(--accent-dark);background:var(--surface)}
.u8-profile .density-option strong{font-size:12px}
.u8-profile .density-option small{font-size:10px;color:var(--muted)}
.u8-profile .u8-list-line{display:flex;align-items:center;gap:12px;padding:12px 0;width:100%;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left}
.u8-profile .u8-list-line strong{display:block;font-size:12px}
.u8-profile .u8-list-line small{display:block;font-size:11px;color:var(--muted)}
.u8-profile .motion-section{margin-top:18px;padding:0;border:0}
.u8-profile .motion-section .row{gap:10px;margin-bottom:8px}
.u8-profile .u8-motion-control{display:flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--btn-radius);font-size:11px;cursor:pointer}
.u8-profile .u8-motion-control .icon{width:16px;height:16px}
.u8-profile .u8-motion-control:has(input:checked){background:var(--accent-soft);color:var(--accent-dark)}
.u8-profile .profile-safety{display:flex;align-items:center;gap:8px;background:transparent;border:0;padding:0;margin:16px 0;font-size:11px}
.u8-profile .u8-personal-note{font-size:11px;line-height:1.6;color:var(--muted);background:var(--surface-2);padding:12px;border-radius:10px;margin-top:16px}
.modal-open{overflow:hidden}
@media(max-width:1190px){:root{--nav:218px}.u8-shell .topbar{padding:0 21px}.u8-shell .main{padding-left:21px;padding-right:21px}.u8-shell .side-brand-row{padding-left:18px;padding-right:18px}.u8-shell .crumb-home{display:none}}
@media(max-width:990px){
 :root{--nav:0px;--top:62px}
 .u8-shell .sidebar{top:calc(var(--stage) + var(--safe-top));width:min(250px,86vw);transform:translateX(-100%);transition:transform .18s;padding-bottom:var(--safe-bottom)}
 .u8-shell .sidebar.open{transform:translateX(0)}
 .u8-shell .sidebar-close{display:inline-flex;width:32px;height:36px}
 .u8-shell .side-brand-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
 .u8-shell .drawer-scrim:not([hidden]){display:block;position:fixed;inset:calc(var(--stage) + var(--safe-top)) 0 0;border:0;background:#22283d65;z-index:40}
 .u8-shell .topbar{left:0;padding:0 20px}.u8-shell .topbar .row>.icon-btn{display:inline-flex}
 .u8-shell .connection{display:none}.u8-shell .main{margin-left:0}.nav-open{overflow:hidden}
}
@media(max-width:700px){
 :root{--top:58px;--stage:28px}
 .u8-shell .topbar{padding:0 10px;gap:6px}
 .u8-shell .top-actions{gap:1px}
 .u8-shell .topbar .crumb{flex:1}.u8-shell .crumb-home,.u8-shell .crumb-slash{display:none}
 .u8-shell .crumb strong{font-size:11px;display:block;overflow-wrap:anywhere;line-height:1.3}
 .u8-shell .top-actions .search-trigger{width:36px;padding:0;justify-content:center}
 .u8-shell .top-actions .search-trigger span,.u8-shell .profile-top,.u8-shell .top-actions>.icon-btn[title="Обновить данные"]{display:none}
 .u8-shell .top-actions .icon-btn{width:36px;height:40px}
 .u8-shell .main{padding:calc(var(--safe-top) + var(--stage) + var(--top) + 17px) 15px calc(94px + var(--safe-bottom));max-width:none}
 .u8-shell .bottomnav{z-index:40;grid-template-columns:repeat(var(--bottom-count),minmax(0,1fr));height:calc(65px + var(--safe-bottom));padding:5px 7px calc(5px + var(--safe-bottom));background:var(--surface);border-color:var(--line);box-shadow:none}
 .u8-shell .bottomnav button{min-height:52px;padding:2px;font-size:10px;gap:5px}
 .u8-shell .bottomnav button.add{gap:0}
 .u8-shell .bottomnav button.add .add-icon{width:44px;height:43px;border-radius:13px;background:var(--primary-bg);color:white;box-shadow:0 5px 12px var(--accent-glow),inset 0 1px 0 #ffffff22}
 .u8-shell .bottomnav button.add .icon{width:25px;height:25px}
 .u8-shell .bottomnav button>.icon{width:21px;height:21px}
 .modal-open .bottomnav{visibility:hidden}
 .u8-dialog,.u8-dialog.wide{width:100%;max-width:none;max-height:calc(var(--vvheight,100dvh) - 12px);inset:auto 0 0;margin:0;border-radius:22px 22px 0 0;border-bottom:0;box-shadow:0 -15px 70px #1b174026}
 .u8-dialog .dialog-head{padding:15px 17px;gap:10px}
 .u8-dialog .dialog-head .icon-btn{width:40px;height:40px}
 .u8-dialog .dialog-content{padding:18px 17px 24px}
 .u8-dialog .dialog-actions{padding:12px 17px calc(12px + var(--safe-bottom));justify-content:stretch}
 .u8-dialog .dialog-actions .btn{flex:1;min-height:44px}
 .u8-dialog .form-grid{grid-template-columns:minmax(0,1fr);gap:16px}.u8-dialog .form-grid .span2{grid-column:auto}
 .u8-dialog .field input,.u8-dialog .field select,.u8-dialog .field textarea{font-size:16px;min-height:46px}
 .u8-dialog .quick-row{padding:15px 12px}.u8-dialog .quick-icon{width:37px;height:37px}
 .u8-profile .density-block{padding:12px}.u8-profile .density-option{padding:11px;min-height:104px}.u8-profile .density-option small{font-size:9px}
}
@media(max-width:360px){.u8-shell .main{padding-left:11px;padding-right:11px}.u8-shell .crumb strong{font-size:10px}.u8-shell .top-actions{gap:0}.u8-shell .top-actions .icon-btn,.u8-shell .top-actions .search-trigger{width:32px}}
@media(max-width:700px) and (max-height:720px){
 body.l6-compact{--stage:26px}
 body.l6-compact .u8-shell .main{padding-top:calc(var(--safe-top) + var(--stage) + var(--top) + 6px);padding-bottom:calc(65px + var(--safe-bottom))}
 body.l6-compact .u8-shell .bottomnav{height:calc(60px + var(--safe-bottom));min-height:60px;padding-top:4px;padding-bottom:calc(4px + var(--safe-bottom))}
 body.l6-compact .u8-shell .bottomnav .add-icon{width:42px;height:42px}
}

/* UIFIX10: screenshot-confirmed PLAN header and final LIVE06 cascade.
   Matches reference 30/34/67/151-169/190/203 and 267-275; no state/data changes. */
.u8-shell .segmented,.u8-dialog .segmented{border-radius:10px;background:var(--surface-2);border:1px solid var(--line);box-shadow:none}
.u8-shell .segmented button,.u8-dialog .segmented button{border-radius:7px;color:var(--muted)}
.u8-shell .segmented .active,.u8-shell .segmented .selected,.u8-dialog .segmented .active,.u8-dialog .segmented .selected{background:var(--surface);color:var(--accent-dark);box-shadow:0 1px 4px #0000000d}
.plan-surface>.plan-page-head{flex-direction:row;align-items:flex-start;gap:20px;margin-bottom:23px;text-align:left}
.plan-surface>.plan-page-head>div:first-child{min-width:0;flex:1}
.plan-surface>.plan-page-head>.btn{flex:none;margin-top:3px}
.plan-surface>.plan-page-head h1{line-height:1.18;letter-spacing:-1px}
.plan-surface>.plan-page-head .muted{font-size:13px;line-height:1.5;margin-top:7px}
.plan-surface .plan-view-switch button{min-height:35px}
@media(max-width:700px){
 :root{--stage:30px}
 .u8-shell .main{padding-left:13px;padding-right:13px}
 .plan-surface>.plan-page-head{gap:12px;margin-bottom:14px}
 .plan-surface>.plan-page-head h1{font-size:24px;line-height:1.2;letter-spacing:-1px}
 .plan-surface>.plan-page-head .muted{font-size:12px;line-height:1.45;margin-top:5px}
 .plan-surface>.plan-page-head>.btn.primary{width:39px;min-width:39px;height:39px;min-height:39px;max-width:60px;padding:9px;margin-top:0}
 .plan-surface>.plan-page-head>.btn.primary .label{display:none}
 .plan-surface .plan-view-switch{padding:3px;gap:1px}
 .plan-surface .plan-view-switch button{min-height:35px}
}
@media(max-width:360px){.plan-surface .plan-view-switch button{font-size:10px;padding:7px 5px}}

/* Focus mode and print remain authoritative, including the LIVE screen's layout. */
body.op-focus .u8-shell .sidebar,body.op-focus .u8-shell .topbar,body.op-focus .u8-shell .stagebar,body.op-focus .u8-shell .bottomnav{display:none!important}
body.op-focus .u8-shell .main{margin-left:0;padding:18px 24px 25px;max-width:none}
@media(max-width:700px){body.op-focus .u8-shell .main{padding:18px 12px calc(25px + var(--safe-bottom))}}
@media(prefers-reduced-motion:reduce){.u8-shell .sidebar,.u8-dialog,.btn{animation:none!important;transition:none!important;transform:none}.u8-shell .sidebar:not(.open){transform:translateX(-100%)}}
@media(prefers-reduced-motion:reduce) and (min-width:991px){.u8-shell .sidebar:not(.open){transform:none}}
body[data-motion=reduced] .u8-shell .sidebar,body[data-motion=reduced] .u8-dialog{animation:none!important;transition:none!important}
@media print{.u8-shell .sidebar,.u8-shell .topbar,.u8-shell .stagebar,.u8-shell .bottomnav,.u8-dialog{display:none!important}.u8-shell .main{padding:0;margin:0}}
