/* KroyPro unified calculator shell — 2026-09-19 */
#kp-global-shell{position:relative;z-index:1500;background:#fff;border-bottom:1px solid #E5E7EB;box-shadow:0 1px 8px rgba(15,23,42,.06);font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:#1F2937}
#kp-global-shell *{box-sizing:border-box}
.kp-shell-inner{max-width:1240px;margin:0 auto;min-height:58px;padding:8px 14px;display:flex;align-items:center;gap:10px}
.kp-shell-product-wrap{position:relative;flex:0 0 auto}
.kp-shell-product{display:flex;align-items:center;gap:7px;min-height:38px;padding:8px 12px;border:1px solid #D7E3EF;border-radius:10px;background:#F5F9FD;color:#174D7C;font:850 13px/1.1 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;cursor:pointer;white-space:nowrap}
.kp-shell-product small{font-size:10px;font-weight:700;opacity:.65}
.kp-shell-menu{display:none;position:absolute;top:calc(100% + 7px);left:0;min-width:255px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;box-shadow:0 14px 38px rgba(15,23,42,.18);padding:7px;z-index:1700}
.kp-shell-menu.open{display:block}
.kp-shell-menu a{display:block;padding:9px 10px;border-radius:9px;text-decoration:none;color:#1F2937;font-size:13px;font-weight:760}
.kp-shell-menu a span{display:block;font-size:11px;color:#6B7280;font-weight:500;margin-top:2px}
.kp-shell-menu a.active{background:#EFF6FF;color:#185FA5}
.kp-shell-menu a:hover{background:#F8FAFC}
.kp-shell-actions{margin-left:auto;display:flex;align-items:center;gap:7px;min-width:0}
.kp-shell-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:36px;padding:7px 10px;border:1px solid #D7E3EF;border-radius:9px;background:#fff;color:#243447;text-decoration:none;font:800 12px/1.1 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;cursor:pointer;white-space:nowrap}
.kp-shell-btn:hover{background:#F8FAFC}
.kp-shell-btn.pro{border-color:#F1C66C;background:#FFF8E7;color:#8A5A00}
.kp-shell-btn.account{background:#185FA5;border-color:#185FA5;color:#fff}
.kp-shell-btn.account.is-user{background:#EFF6FF;border-color:#BFD6EC;color:#185FA5}
.kp-shell-install-host{display:flex;align-items:center}
#kp-global-shell #kp-install-app-btn{position:static!important;right:auto!important;bottom:auto!important;z-index:auto!important;min-height:36px!important;padding:7px 10px!important;border-radius:9px!important;font-size:12px!important;box-shadow:none!important}
.kp-shell-mobile-row{display:none}

/* Keep each calculator's own stepper, but remove duplicate global/account controls. */
body.kp-shell-active.kp-app-ldsp>header .prod-switcher,
body.kp-shell-active.kp-app-ldsp>header .logo,
body.kp-shell-active.kp-app-ldsp>header .kp-master-nav,
body.kp-shell-active.kp-app-ldsp>header #pro-btn,
body.kp-shell-active.kp-app-ldsp>header #login-btn,
body.kp-shell-active.kp-app-ldsp>header #user-info{display:none!important}
body.kp-shell-active.kp-app-ldsp>header{justify-content:center!important;gap:10px!important}

body.kp-shell-active.kp-app-kroytile>header.hdr{display:none!important}

body.kp-shell-active.kp-app-kroytex>header.hdr .prod-switcher,
body.kp-shell-active.kp-app-kroytex>header.hdr .logo,
body.kp-shell-active.kp-app-kroytex>header.hdr .hdr-right{display:none!important}
body.kp-shell-active.kp-app-kroytex>header.hdr{justify-content:center!important}

body.kp-shell-active.kp-app-oboi>header{display:none!important}

/* Unified dialogs */
.kp-shell-overlay{position:fixed;inset:0;z-index:2147482500;background:rgba(15,23,42,.58);display:flex;align-items:center;justify-content:center;padding:16px;font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
.kp-shell-dialog{width:min(440px,100%);max-height:90vh;overflow:auto;background:#fff;color:#1F2937;border-radius:16px;box-shadow:0 24px 72px rgba(0,0,0,.28);padding:20px}
.kp-shell-dialog h2{margin:0 0 6px;font-size:20px}
.kp-shell-dialog p{font-size:13px;line-height:1.5;color:#5B6472}
.kp-shell-tabs{display:flex;gap:6px;margin:14px 0}
.kp-shell-tab{flex:1;border:1px solid #D7E3EF;background:#F8FAFC;border-radius:9px;padding:8px;font-weight:800;cursor:pointer}
.kp-shell-tab.active{background:#EAF3FB;border-color:#9FC2E3;color:#185FA5}
.kp-shell-field{width:100%;height:42px;border:1px solid #CBD5E1;border-radius:9px;padding:0 11px;margin:0 0 9px;font:14px system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
.kp-shell-check{display:flex;align-items:flex-start;gap:7px;font-size:12px;color:#4B5563;margin:5px 0 10px}
.kp-shell-primary{width:100%;border:0;border-radius:10px;background:#185FA5;color:#fff;padding:11px 14px;font-weight:850;cursor:pointer;font-size:14px}
.kp-shell-secondary{width:100%;border:1px solid #D7E3EF;border-radius:10px;background:#fff;color:#334155;padding:10px 14px;font-weight:800;cursor:pointer;font-size:13px;margin-top:8px}
.kp-shell-msg{min-height:19px;margin:8px 0 0;font-size:12px;font-weight:700;color:#B42318}
.kp-shell-links{display:flex;justify-content:space-between;gap:8px;margin-top:10px;font-size:12px}
.kp-shell-links a,.kp-shell-links button{border:0;background:none;padding:0;color:#185FA5;text-decoration:none;cursor:pointer;font:inherit}

@media(max-width:720px){
  .kp-shell-inner{min-height:auto;padding:7px 8px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
  .kp-shell-product{width:100%;min-width:0;justify-content:flex-start;overflow:hidden;text-overflow:ellipsis}
  .kp-shell-product .kp-shell-product-sub{display:none}
  .kp-shell-actions{margin:0;gap:5px}
  .kp-shell-actions>.kp-shell-btn.master,
  .kp-shell-actions>.kp-shell-btn.projects,
  .kp-shell-actions>.kp-shell-btn.pro{display:none}
  .kp-shell-actions>.kp-shell-install-host{display:contents}
  .kp-shell-btn.account{min-height:38px;padding:7px 9px}
  .kp-shell-mobile-row{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
  .kp-shell-mobile-row .kp-shell-btn{width:100%;min-height:36px;padding:6px 5px;font-size:11.5px}
  .kp-shell-menu{min-width:min(290px,calc(100vw - 20px))}
  /* The install CTA stays intentionally visible as a floating action on phones. */
  #kp-global-shell #kp-install-app-btn{position:fixed!important;right:11px!important;bottom:68px!important;z-index:1800!important;min-height:42px!important;padding:10px 13px!important;border-radius:13px!important;font-size:13px!important;box-shadow:0 5px 18px rgba(0,0,0,.22)!important}
  body.kp-shell-active.kp-app-ldsp>header{padding:4px 8px!important;min-height:0!important}
  body.kp-shell-active.kp-app-kroytex>header.hdr{padding:4px 8px!important;min-height:0!important}
}
@media print{#kp-global-shell,.kp-shell-overlay{display:none!important}}


/* 2026-09-19 mobile compact shell + LDSP result fix */
@media(max-width:720px){
  #kp-global-shell{position:sticky;top:0;z-index:1500}
  .kp-shell-inner{padding:6px 8px;gap:6px}
  .kp-shell-product{min-height:34px;padding:6px 10px;border-radius:9px;font-size:12px}
  .kp-shell-actions>.kp-shell-btn.account{min-height:34px;padding:6px 10px;font-size:12px;border-radius:9px}
  .kp-shell-mobile-row{gap:5px}
  .kp-shell-mobile-row .kp-shell-btn{min-height:32px;padding:5px 4px;font-size:11px;border-radius:8px}
  body.kp-shell-active.kp-app-kroytile main h1:first-of-type,
  body.kp-shell-active.kp-app-kroytex main h1:first-of-type,
  body.kp-shell-active.kp-app-oboi main h1:first-of-type{font-size:clamp(1.55rem,7.2vw,2.15rem)!important;line-height:1.08!important;margin-top:8px!important;margin-bottom:10px!important}
}
@media(max-width:600px){
  body.kp-shell-active.kp-app-ldsp #ldsp-sheet-toolbar{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:10px!important}
  body.kp-shell-active.kp-app-ldsp #ldsp-sheet-toolbar .sheet-tabs{width:100%;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;padding-bottom:4px;margin-bottom:0}
  body.kp-shell-active.kp-app-ldsp #ldsp-sheet-toolbar .sheet-tab{flex:0 0 auto}
  body.kp-shell-active.kp-app-ldsp #ldsp-sheet-toolbar .ldsp-zoom-controls{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%}
  body.kp-shell-active.kp-app-ldsp #ldsp-sheet-toolbar .ldsp-zoom-controls .btn{width:100%;justify-content:center;padding-left:4px;padding-right:4px;font-size:.82rem}
  body.kp-shell-active.kp-app-ldsp #sheet-nav-hint{display:none!important}
  body.kp-shell-active.kp-app-ldsp #canvas-wrap{min-height:220px;padding:12px;align-items:flex-start;justify-content:flex-start}
  body.kp-shell-active.kp-app-ldsp .export-row{gap:6px}
  body.kp-shell-active.kp-app-ldsp .export-row .btn,
  body.kp-shell-active.kp-app-ldsp .export-row .cloud-btn{flex:1 1 calc(50% - 6px);justify-content:center;text-align:center}
}


/* 2026-09-19 unified mobile header v3 */
@media(max-width:720px){
  #kp-global-shell{position:sticky;top:0;z-index:1500}
  .kp-shell-inner{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;padding:6px 8px!important;min-height:0!important}
  .kp-shell-product-wrap{width:100%!important}
  .kp-shell-product{width:100%!important;min-height:34px!important;padding:6px 10px!important;border-radius:9px!important;font-size:12px!important;justify-content:flex-start!important}
  .kp-shell-actions{width:100%!important;margin:0!important;display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:5px!important}
  .kp-shell-actions>.kp-shell-btn{display:inline-flex!important;width:100%!important;min-width:0!important;min-height:32px!important;padding:5px 4px!important;border-radius:8px!important;font-size:11px!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .kp-shell-actions>.kp-shell-btn.master{grid-column:span 2!important}
  .kp-shell-actions>.kp-shell-btn.projects{grid-column:span 2!important}
  .kp-shell-actions>.kp-shell-btn.pro{grid-column:span 2!important}
  .kp-shell-actions>.kp-shell-install-host{display:flex!important;grid-column:span 3!important;min-width:0!important}
  .kp-shell-actions>.kp-shell-btn.account{grid-column:span 3!important;min-height:32px!important;padding:5px 4px!important;font-size:11px!important;border-radius:8px!important}
  #kp-global-shell #kp-install-app-btn{position:static!important;right:auto!important;bottom:auto!important;z-index:auto!important;width:100%!important;min-height:32px!important;padding:5px 4px!important;border-radius:8px!important;font-size:11px!important;box-shadow:none!important;opacity:1!important;pointer-events:auto!important;transform:none!important}
  .kp-shell-mobile-row{display:none!important}
}
