/* D-tect mobile platform skin. Desktop keeps the existing platform unchanged.
   Uses the original :root brand tokens, DOM, permissions and application handlers. */
@media (max-width:720px) {
body{
  /* Inherit the deployed D-tect palette from :root; do not fork brand colours. */
  background:var(--bg);font-size:14px;letter-spacing:-.015em;
}
body :is(button,a,input,select,textarea){font-family:inherit;touch-action:manipulation}
body :is(button,a,input,select,textarea):focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 50%,transparent);outline-offset:3px}
body button:disabled{cursor:not-allowed;opacity:.45}
body .sidebar{width:244px;padding:30px 17px 24px;background:var(--accent-h);color:var(--accent-wash);border:0;overflow-y:auto}
body .side-brand{padding:0 14px 32px;gap:12px}
body .side-brand img{width:34px!important;height:34px!important}
body .side-brand .nm{font-size:16px;line-height:1.4;letter-spacing:-.3px;color:#fff}
body .orgpick{background:#ffffff09;border-color:#ffffff20;color:var(--panel2);padding:12px;margin-bottom:20px;border-radius:10px}
body .orgpick .flag{background:#ffffff20;color:var(--accent-wash);width:24px;height:24px}
body .nav{gap:5px}
body .navlbl{font-size:10px;letter-spacing:1.1px;color:var(--line2);padding:20px 13px 8px}
body :is(.nav a,.navx){color:var(--line);padding:12px 13px;border-radius:9px;font-size:13px;font-weight:500;gap:12px}
body :is(.nav a i,.navx i){color:var(--line2);font-size:19px}
body :is(.nav a:hover,.navx:hover:not(:disabled)){background:#ffffff09;color:white}
body .nav a.on{background:var(--accent-wash);color:var(--accent-h);font-weight:750}
body .nav a.on i{color:var(--accent)}
body .navsub{padding:0}
body .navsub2{padding:0 0 4px 10px}
body .navsub2 a{font-size:13px}
body .navsub2 a.on{background:var(--accent-wash);color:var(--accent-h)}
body .navgrp{background:transparent;border-color:#ffffff1a;border-style:solid;margin:16px 0 0}
body .nbadge{background:var(--warn-bg);color:var(--warn)}
body .main{overscroll-behavior:contain;scrollbar-gutter:stable}
body .mtop{min-height:76px;padding:18px 36px;background:#ffffffef;backdrop-filter:blur(14px);gap:12px}
body .orgttl{font-size:13px;font-weight:500;color:var(--muted);padding:0;max-width:35%}
body .mtop .ttl{font-size:13px;font-weight:650}
body .main-inner{padding:36px 36px 70px;max-width:1440px}
body .page-h{margin-bottom:12px;gap:12px}
body .page-h h1{font-size:29px;letter-spacing:-1.3px;font-weight:750}
body .page-desc{font-size:12.5px;line-height:1.8;margin-bottom:24px;max-width:850px}
body .sechead{margin-bottom:18px}
body .sechead h2{font-size:21px;font-weight:700;letter-spacing:-.6px}
body .cards{gap:12px;grid-template-columns:repeat(3,minmax(0,1fr))}
body .cards.few{grid-template-columns:repeat(2,minmax(0,1fr));max-width:none}
body .stat{padding:22px 22px 18px;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}
body .stat .k{font-size:12px;font-weight:550;color:var(--muted)}
body .stat .v{font-size:36px;font-weight:600;letter-spacing:-1px;line-height:1.2;margin:10px 0;color:var(--text);font-variant-numeric:tabular-nums}
body .stat .d{font-size:11px}
body .stat:first-child{background:var(--accent-wash);border-color:var(--line2)}
body :is(.section,.dashcard,.team){border-radius:14px;border-color:var(--line);box-shadow:var(--shadow)}
body .section{padding:20px}
body .dashgrid{gap:16px}
body .dashcard .dh{padding:20px 20px 0;font-size:14px}
body .dashcard .dbody{padding:16px 20px 20px}
body .dashcard:has(.soon) .dbody{display:grid;place-content:center;gap:16px}
body .dashcard:has(.soon) .dbody::before{content:"—";display:grid;place-items:center;width:60px;height:60px;border:1px solid var(--line);border-radius:18px;background:var(--panel2);color:var(--muted);font-size:27px;margin:auto}
body :is(.btn.sm,.btn.tiny){border-radius:8px;min-height:36px;padding:8px 12px;font-weight:600;line-height:1.4}
body .btn.ghost{background:#fff;border-color:var(--line2)}
body .iconbtn{border-radius:8px;width:34px;height:34px;color:var(--muted)}
body .iconbtn.plain:hover{background:var(--accent-wash)}
body :is(input,select,textarea){border-radius:9px;background:var(--panel2);border-color:var(--line2);font-size:13px;min-height:38px}
body :is(input[type=checkbox],input[type=radio]){min-height:0;accent-color:var(--accent)}
body .add-row{padding:14px;background:var(--panel2);border:1px solid var(--line);border-radius:12px;margin:20px 0}
body .add-row input{background:#fff}
body .cx{border-radius:14px;margin-bottom:16px;border-color:var(--line);box-shadow:var(--shadow)}
body .cx-head{padding:17px 18px;background:#fff;min-height:68px;gap:10px}
body .cx-head:hover{background:var(--panel2)}
body .cx-name{font-size:14px;overflow-wrap:anywhere}
body .cx-body{padding:0 16px 14px}
body .cx-body>.cx{border:0;border-left:2px solid var(--line2);border-radius:0;box-shadow:none;margin-left:8px;background:var(--panel2)}
body .cx-body>.cx>.cx-head{background:var(--panel2)!important;padding:12px 14px;min-height:52px}
body .cx-body>.cx>.cx-body{padding:12px 12px 6px}
body .bd{padding:12px;gap:7px;flex-wrap:wrap;line-height:1.4;margin-bottom:8px;border-radius:10px;box-shadow:none}
body .bd>.nm{font-size:12px}
body .bd>.muted{min-width:110px!important;white-space:normal!important;overflow-wrap:anywhere;font-size:12px!important}
body .chip{font-size:10px;padding:4px 7px;line-height:1.2;border-radius:6px}
body .chip.on{background:var(--accent-wash);color:var(--accent-h)}
body .chip.off{background:var(--panel2);color:var(--muted)}
body :is(#pmap-slot,#dash-map-slot,#pmap){border-radius:12px;overflow:hidden}
body #pmap-slot{height:250px}
body .pmap-note{bottom:30px;border-radius:7px;font-size:11px}
body .infopane{flex-basis:264px;padding:25px 18px;background:var(--panel2);gap:20px}
body .ip-who{gap:10px;padding-bottom:23px}
body .ava{border-radius:12px;background:var(--accent-wash);color:var(--accent-h);font-size:13px;font-weight:650}
body .ip-nm{font-size:13px}
body .ip-em{font-family:inherit;font-size:10px;margin-top:6px}
body .ipbox{border-radius:12px;background:white}
body .ipbox>.hd{font-size:10px;letter-spacing:.4px;padding:13px}
body .plist{padding:12px;font-size:11px}
body .plist .nm{font-weight:500}
body .ipkv{padding:11px;font-size:11px}
body .mem{padding:15px 18px;gap:13px}
body .mem select{width:95px;flex:0 0 auto}
body .team-h{background:var(--panel2);padding:17px 20px}
body .code-bar{background:var(--panel2);padding:13px;border-radius:10px}
body :is(.pmodal,.up-modal){background:#0e283078;backdrop-filter:blur(5px);padding:24px;z-index:10000}
body :is(.pm-box,.up-box){border-radius:20px;border:1px solid var(--line);box-shadow:0 28px 100px #0e283046;padding:28px;max-height:calc(100dvh - 64px);overflow:auto}
body .pm-title{font-size:21px;line-height:1.4;font-weight:720;letter-spacing:-.6px;margin-bottom:10px;padding-right:16px}
body .pm-sub{font-size:13px;line-height:1.7;margin-bottom:24px}
body .pm-opt{padding:16px;border-radius:12px;border-color:var(--line2);margin:0}
body .pm-opt:has(input:checked){background:var(--accent-wash);border-color:var(--accent)}
body .pm-actions{padding-top:18px;gap:10px}
body .pm-actions button{min-height:42px}
body .two{gap:14px}
body .toast{border-radius:12px;background:var(--accent-h);color:#fff;padding:14px 20px;box-shadow:0 12px 35px #0e28302a}
body .section:has(table){overflow-x:auto}
body table th{font-weight:600;border-bottom:1px solid var(--line)}
body table td{padding:16px 10px!important;border-bottom:1px solid var(--line);font-size:12px}
body .card{border-radius:22px;box-shadow:0 24px 75px #0e28300f;padding:35px}
body .pvgrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
body .pvcell{border-radius:12px;border-color:var(--line);background:var(--panel2)}
body .pvimg{height:220px;object-fit:cover}
body .pvname{font-size:11px;padding:11px}
body .sechead{flex-wrap:wrap;gap:10px}
body .sechead>.muted{line-height:1.6}
body #screen-auth #btn-primary{background:var(--accent);box-shadow:none}
body #screen-auth input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}
@media(min-width:1700px){body .cards:not(.few){grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:1280px){body .infopane{display:none}}
@media(min-width:721px) and (max-width:1000px){
  body .sidebar{width:215px;padding:24px 10px}
  body .main-inner{padding:25px 22px 60px}
}
@media(max-width:720px){
  body .sidebar{width:min(300px,85vw);padding:30px 18px;overscroll-behavior:contain}
  body .sidebar :is(a,button){min-height:44px}
  body .main{width:100%;scrollbar-gutter:auto}
  body .mtop{padding:10px 16px;min-height:64px;gap:8px}
  body .mtop .orgttl{font-size:11px;max-width:40%;white-space:nowrap}
  body .mtop .ttl{font-size:12px;white-space:nowrap}
  body .mtop #top-logout{flex:0 0 auto}
  body .main-inner{padding:26px 18px calc(90px + env(safe-area-inset-bottom))}
  body .page-h{gap:7px}
  body .page-h h1{font-size:25px;letter-spacing:-.8px}
  body .page-desc{font-size:12px;line-height:1.75;margin-bottom:20px}
  body .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  body .stat{padding:17px}
  body .stat .v{font-size:31px}
  body .dashgrid{grid-template-columns:1fr}
  body .sechead h2{font-size:23px}
  body :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;min-height:46px}
  body :is(input[type=checkbox],input[type=radio]){width:20px;height:20px;flex:0 0 auto}
  body :is(.btn.sm,.btn.tiny,.iconbtn){min-height:44px}
  body .iconbtn{width:44px;height:44px}
  body .cx-head{padding:16px 13px;gap:8px;min-height:72px}
  body .cx-head>.spacer{display:none}
  body .cx-name{font-size:14px;flex:1;min-width:100px}
  body .cx-body{padding:0 10px 12px}
  body .cx-body>.cx{margin-left:2px}
  body .cx-body>.cx>.cx-body{padding:8px}
  body .bd{padding:13px 11px;gap:7px;border-radius:11px}
  body .bd>.muted{flex-basis:100%!important;min-width:0!important;line-height:1.6;font-size:13px!important;color:var(--text)}
  body .bd>.nm{font-size:11px;color:var(--muted)}
  body .bd>.iconbtn{border:1px solid var(--line);background:var(--accent-wash);flex:1;max-width:none;gap:4px}
  body :is([data-openins],[data-open2d],[data-p2dview])::after{content:attr(title);font-size:11px;line-height:1.4}
  /* Mobile is a viewer. Existing authoring DOM/handlers remain intact for desktop. */
  body :is(.add-row,.bd:has([data-addins]),.bd:has([data-p2dadd]),
    [data-addbd],[data-access],[data-rencx],[data-delcx],[data-renbd],[data-delbd],
    [data-upins],[data-up2d],[data-renins],[data-delins],[data-openelevation],
    [data-p2dup],[data-p2dedit],[data-p2ddelins],[data-p2dren],[data-p2ddel],[data-p2dshare],
    [data-role],[data-move],[data-transfer],[data-delteam],#add-team,#regen-code,
    #pr-install,#nt-new,#nav-app-download,#nav-label,
    #p2d-go,#p2d-retry,[data-prrs],[data-prcx],
    [data-ntedit],[data-ntdel],[data-approve],[data-reject],
    [data-alcancel],[data-alapprove],[data-aldismiss],
    #p2d-more,#p2d-review,#p2d-mkreport,#p2d-mklink,[data-rdel],[data-lkdl],
    #p2d-report-link-modal .pm-list,
    .section:has([onclick*="hgProcInstall"]),.section:has(#p2d-guide)){display:none!important}
  body .mem{padding:13px;gap:11px}
  body .section{padding:17px}
  body :is(.pmodal,.up-modal){padding:12px;align-items:center}
  body :is(.pm-box,.up-box){width:100%!important;max-width:500px;max-height:calc(100dvh - 32px)!important;padding:24px 20px;border-radius:20px}
  body .pm-title{font-size:20px}
  body .two{grid-template-columns:1fr;gap:6px}
  body .pm-actions{position:sticky;bottom:-24px;background:white;padding:16px 0 4px;box-shadow:0 -10px 20px white}
  body .pm-actions .btn{flex:1;min-height:46px}
  body .pm-opt{padding:14px 12px}
  body .card{padding:28px 22px}
  body .pvgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  body .pvimg{height:185px}
  body .pvname{font-size:10px;padding:9px}
  body #view-files2d .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body #view-files2d .cards .stat:last-child:nth-child(3){grid-column:1/-1}
  body #p2d-back+h1{font-size:20px}
}
@media(prefers-reduced-motion:reduce){body *{scroll-behavior:auto;transition:none!important;animation:none!important}}
}
