/* General visual book frame. Intelligence owns its separate, clear composition. */
.book-shell{--radius:10px;--line:var(--brand-border);--shadow:0 3px 12px color-mix(in srgb,var(--brand-primary) 1.57%,transparent);--rb-mobile-nav-height:64px;font-size:13px;background:color-mix(in srgb,var(--brand-primary) 4.00%,var(--brand-surface))}
.book-shell.prism-v2{grid-template-columns:200px minmax(0,1fr)}
.book-shell.prism-v2 .sidebar{width:200px;padding:24px 12px 14px;background:var(--brand-navy)}
.book-shell.prism-v2 .brand{font-size:23px;gap:8px;padding:0 10px;letter-spacing:2px}
.book-shell .brand img{width:28px;height:28px}
.book-shell .brand-sub{padding:0 10px;margin:10px 0 0;font-size:7px;line-height:1.7;letter-spacing:1.4px}
.book-shell .workspace-badge{margin:23px 0 21px;padding:10px 8px;border-radius:6px;gap:8px}
.book-shell .workspace-badge strong{font-size:10px}.book-shell .workspace-badge small{font-size:8px}
.book-shell.prism-v2 .nav-label{font-size:7px;margin:5px 0 8px;padding:0 10px;letter-spacing:1.2px}
.book-shell.prism-v2 .nav-link{font-size:11px;min-height:36px;padding:8px 10px;margin:3px 0;border-radius:6px;gap:9px}
.book-shell.prism-v2 .nav-link .icon{width:15px;height:15px}
.book-shell .intelligence-nav-label{margin-top:20px!important}
.book-shell.prism-v2 .sidebar-bottom{padding-top:20px}
.book-shell .local-card{padding:11px 9px;margin-bottom:14px;border-radius:6px}
.book-shell .local-card strong{font-size:10px}.book-shell .local-card p{font-size:9px;line-height:1.65;margin-top:5px}
.book-shell .user-block{gap:6px;padding-top:12px}.book-shell .user-block .avatar{width:28px;height:28px;border-radius:50%;font-size:9px}
.book-shell .user-block>div{min-width:0}.book-shell .user-block strong{font-size:10px}.book-shell .user-block small{font-size:8px}
.book-shell.prism-v2 .topbar{height:52px;padding:0 24px;gap:12px;background:var(--brand-surface)}
.book-shell .breadcrumbs{font-size:10px;gap:7px}.book-shell .top-actions{gap:15px}.book-shell .global-search{width:280px;min-height:30px;background:color-mix(in srgb,var(--brand-primary) 4.00%,var(--brand-surface))}
.book-shell .global-search input{min-height:28px;font-size:10px}.book-shell .sync-status{font-size:9px}.book-shell .top-avatar .avatar{width:27px;height:27px;border-radius:50%}
.book-shell.prism-v2 .main{padding:24px;max-width:1800px}
.book-shell .page-heading{margin-bottom:20px;gap:14px}.book-shell .eyebrow{font-size:8px;letter-spacing:1.45px;margin-bottom:7px}
.book-shell .page-heading h1{font-size:25px;line-height:1.2;letter-spacing:-.8px;margin-top:0}
.book-shell .page-heading p{font-size:11px;line-height:1.6;margin-top:6px}
.book-shell .heading-actions{gap:8px}.book-shell .btn{font-size:11px;min-height:36px;padding:8px 12px;border-radius:6px}
.book-shell .btn .icon{width:14px;height:14px}.book-shell .panel{border-radius:10px}
.book-shell .panel-head{padding:16px 18px 13px}.book-shell .panel-head h2{font-size:15px}.book-shell .panel-head p{font-size:10px}
.book-shell .panel-pad{padding:18px}.book-shell .stack{gap:16px}
.book-shell .toolbar{padding:13px 16px;gap:12px}.book-shell .tab{font-size:11px;padding:8px 10px;min-height:33px}
.book-shell .filter-search{min-height:34px}.book-shell .filter-search input{min-height:32px;font-size:11px;border:0;background:transparent;box-shadow:none}
.book-shell .filter-search:focus-within{border-color:var(--brand-primary);outline:3px solid color-mix(in srgb,var(--brand-primary) 30%,var(--brand-surface));outline-offset:3px}
.book-shell .filter-search input:focus-visible{outline:0;box-shadow:none}
.book-shell .status,.book-shell .priority{font-size:10px;padding:4px 7px;border-radius:5px}
.book-shell .data-table{font-size:11px}.book-shell .data-table td{padding:12px 16px}.book-shell .data-table th{font-size:8px;padding:11px 16px;letter-spacing:.7px}
.book-shell .row-title{font-size:12px;line-height:1.45}.book-shell .row-sub{font-size:10px;margin-top:4px;line-height:1.4}
.book-shell .person-inline{font-size:10px}.book-shell .person-inline .avatar{width:26px;height:26px;font-size:9px}
.book-shell .table-footer{font-size:9px;padding:12px 16px}.book-shell .empty{padding:25px 18px}.book-shell .empty h3{font-size:14px}.book-shell .empty p{font-size:11px}
.book-shell .footer-note{font-size:9px;margin-top:22px;padding-top:14px}.book-shell .detail-item small{font-size:9px}.book-shell .detail-item strong{font-size:12px}
.book-shell .back-link{font-size:11px;margin-bottom:14px}.book-shell .notice{font-size:11px;padding:12px;border-radius:7px}
.book-shell .btn,.book-shell .nav-link,.book-shell .panel a,.book-shell .machine-card,.book-shell .tab{transition:background-color 170ms,border-color 170ms,box-shadow 170ms,transform 170ms}
.book-shell :is(button,a,input,textarea,select):focus-visible{outline:2px solid color-mix(in srgb,var(--brand-primary) 30.00%,var(--brand-surface));outline-offset:3px}
.book-shell :is(button,.btn):active{transform:translateY(1px)}
.book-shell.route-interventions .page-heading{margin-bottom:20px}.book-shell.route-interventions .data-table{table-layout:fixed;width:100%}
.book-shell.route-interventions .data-table th:first-child{width:40%}.book-shell.route-interventions .data-table th:last-child{width:35px}
.book-shell.route-interventions .row-title{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.book-shell.route-sync .stock-summary{padding:16px 20px;margin-bottom:18px;border-radius:9px;gap:22px}.book-shell.route-sync .stock-summary strong{font-size:23px}
.book-shell.route-sync .queue-item{padding:17px 20px}.book-shell.route-sync .queue-item h3{font-size:13px}.book-shell.route-sync .queue-item p{font-size:11px}.book-shell.route-sync .section-gap{margin-top:16px}
@media(max-width:1100px) and (min-width:761px){.book-shell.prism-v2{grid-template-columns:174px minmax(0,1fr)}.book-shell.prism-v2 .sidebar{width:174px;padding-left:8px;padding-right:8px}.book-shell.prism-v2 .main{padding:20px}.book-shell.prism-v2 .topbar{padding:0 20px}.book-shell .workspace-badge{gap:6px}.book-shell.prism-v2 .nav-link{font-size:10px;gap:7px}.book-shell .local-card{padding:10px 7px}.book-shell .user-block small{font-size:7px}.book-shell .user-block strong{font-size:9px}.book-shell .page-heading{flex-wrap:wrap}}
@media(max-width:760px){.book-shell.prism-v2{display:block}.book-shell.prism-v2 .sidebar{display:none}.book-shell.prism-v2 .topbar{height:54px;padding:0 16px}.book-shell.prism-v2 .main{padding:20px 16px 94px}.book-shell .top-actions{gap:5px}.book-shell .sync-status{font-size:9px;max-width:155px}.book-shell .mobile-brand{font-size:20px!important}.book-shell .page-heading{margin-bottom:17px}.book-shell .page-heading h1{font-size:23px;line-height:1.2}.book-shell .page-heading p{font-size:11px}.book-shell .heading-actions{margin-top:12px;flex-wrap:wrap}.book-shell .btn{min-height:44px;font-size:12px}.book-shell .panel-head{padding:15px 16px}.book-shell .panel-pad{padding:16px}.book-shell .bottom-nav{min-height:64px;padding:4px 5px calc(5px + env(safe-area-inset-bottom))!important}.book-shell .bottom-nav a{min-height:50px;padding:5px;min-width:53px}.book-shell .bottom-nav .icon{width:18px;height:18px}.book-shell .footer-note{font-size:8px;gap:12px;line-height:1.6}.book-shell .dot-list{display:none}.book-shell .toolbar{padding:12px}.book-shell .tab{min-height:42px}.book-shell .filter-search input{min-height:42px;font-size:16px}.book-shell .data-table td{padding:12px}.book-shell .data-table th{padding:10px 12px}.book-shell .table-footer>span:last-child{display:none}.book-shell.route-interventions .data-table th:first-child{width:auto}.book-shell.route-interventions .data-table th:nth-last-child(3){width:92px}.book-shell.route-interventions .data-table th:last-child{width:25px}.book-shell.route-interventions .row-title{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.book-shell.route-sync .stock-summary{padding:12px;gap:13px}.book-shell.route-sync .stock-summary strong{font-size:20px}.book-shell.route-sync .queue-item{padding:16px}.book-shell.route-sync .heading-actions .btn{flex:1}.book-shell .data-table .status{font-size:9px}}
@media(prefers-reduced-motion:reduce){.book-shell *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* The creation panel keeps the focused two-column form from book page 5. */
#drawer:has(#new-intervention-form){width:620px;height:auto;max-height:calc(100dvh - 48px);top:24px;right:24px;bottom:auto;border-radius:12px;margin:0;box-shadow:0 12px 70px color-mix(in srgb,var(--brand-primary) 18.82%,transparent)}
#drawer:has(#new-intervention-form) .dialog-head{padding:23px 24px 20px;background:var(--brand-surface)}
#drawer:has(#new-intervention-form) .dialog-head h2{font-size:23px;letter-spacing:-.6px}
#drawer:has(#new-intervention-form) .dialog-head p{font-size:11px;line-height:1.7}
#drawer:has(#new-intervention-form) .dialog-body{padding:22px 24px 8px}
#drawer:has(#new-intervention-form) .form-grid{gap:15px 14px}
#drawer:has(#new-intervention-form) .form-group{margin:0}
#drawer:has(#new-intervention-form) label{font-size:11px;font-weight:500}
#drawer:has(#new-intervention-form) input,#drawer:has(#new-intervention-form) select{font-size:12px;min-height:40px;padding:10px}
#drawer:has(#new-intervention-form) textarea{min-height:100px;font-size:12px}
#drawer:has(#new-intervention-form) .help{font-size:10px;margin-top:9px}
#drawer:has(#new-intervention-form) .dialog-footer{padding:20px 24px 24px;background:var(--brand-surface);border:0}
#drawer:has(#new-intervention-form) .dialog-footer .btn{min-height:38px;font-size:11px}
@media(max-width:760px){#drawer:has(#new-intervention-form){width:calc(100% - 24px);max-height:calc(100dvh - 24px);top:12px;right:12px;border-radius:10px}#drawer:has(#new-intervention-form) .dialog-head{padding:20px 18px 17px}#drawer:has(#new-intervention-form) .dialog-head h2{font-size:21px}#drawer:has(#new-intervention-form) .dialog-body{padding:18px 18px 8px}#drawer:has(#new-intervention-form) input,#drawer:has(#new-intervention-form) select,#drawer:has(#new-intervention-form) textarea{font-size:16px;min-height:44px}#drawer:has(#new-intervention-form) .dialog-footer{padding:17px 18px 20px}#drawer:has(#new-intervention-form) .dialog-footer .btn{min-height:44px;font-size:12px}}
@media(max-width:760px){.book-shell.route-interventions .toolbar .tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;width:100%}.book-shell.route-interventions .toolbar .tab{flex-shrink:0}}

/* Keep the full desktop navigation within a short laptop window. */
@media(min-width:761px) and (max-height:800px){
 .book-shell.prism-v2 .sidebar{padding-top:18px;padding-bottom:10px}
 .book-shell .workspace-badge{margin:17px 0 15px;padding:8px}
 .book-shell.prism-v2 .nav-link{min-height:33px;padding:7px 9px;font-size:10.5px;gap:8px;white-space:nowrap}
 .book-shell .intelligence-nav-label{margin-top:15px!important}
 .book-shell.prism-v2 .sidebar-bottom{padding-top:14px}
 .book-shell .local-card{padding:9px 8px;margin-bottom:10px}
 .book-shell .local-card p{line-height:1.5;margin-top:4px}
 .book-shell .user-block{padding-top:10px}
 .book-shell.prism-v2.route-dashboard .main{padding:18px 22px}
}

/* The modal owns scrolling while it is open; keep the underlying page in place. */
html:has(#drawer[open]),body:has(#drawer[open]){overflow:hidden}

/* At 320 px keep every header action reachable, with the sync name still accessible. */
@media(max-width:360px){
 .book-shell .topbar .sync-status{width:44px;min-width:44px;max-width:44px;min-height:44px;padding:0;justify-content:center;font-size:0}
 .book-shell .topbar #sync-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
 .book-shell .topbar .sync-status .status-dot{width:8px;height:8px;flex-shrink:0}
}
