/* ===== v208/v210 DiagnostiX Software App Shell =====
   Additive layer only: does not change Bluetooth, login, storage or diagnostic logic. */
:root{
  --dx-soft-top: 74px;
  --dx-soft-workbar: 54px;
  --dx-soft-status: 34px;
  --dx-soft-sidebar: 284px;
  --dx-soft-border: rgba(148, 163, 184, .18);
  --dx-soft-panel: rgba(8, 13, 26, .78);
  --dx-soft-panel-strong: rgba(12, 18, 34, .92);
  --dx-soft-text: #f8fafc;
  --dx-soft-muted: rgba(226, 232, 240, .68);
}

html.dx-software-mode,
body.dx-software-shell-active{
  min-height:100%;
}
body.dx-software-shell-active[data-page="home"]{
  background:#060914;
}
body.dx-software-shell-active[data-page="home"] .diagnostix-app-shell{
  position:relative;
}
body.dx-software-shell-active[data-page="home"] .app-topbar-v2{
  border-bottom:1px solid var(--dx-soft-border);
  box-shadow:0 18px 34px rgba(0,0,0,.18);
}

.dx-software-workbar-v208{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  width:100%;
  min-height:var(--dx-soft-workbar);
  padding:10px 18px;
  border-bottom:1px solid var(--dx-soft-border);
  background:linear-gradient(180deg, rgba(13, 20, 36, .88), rgba(10, 15, 28, .74));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  z-index:34;
}
.dx-software-workbar-left-v208,
.dx-software-workbar-actions-v208,
.dx-software-workbar-system-v208{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.dx-software-module-v208{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.dx-software-module-v208::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 0 5px rgba(34,197,94,.13), 0 0 18px rgba(34,197,94,.42);
  flex:0 0 auto;
}
.dx-software-module-text-v208{
  display:flex;
  flex-direction:column;
  min-width:0;
  line-height:1.1;
}
.dx-software-module-text-v208 small{
  color:var(--dx-soft-muted);
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-weight:800;
}
.dx-software-module-text-v208 strong{
  color:var(--dx-soft-text);
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dx-software-workbar-v208 .dx-soft-btn-v208{
  border:1px solid rgba(148,163,184,.2);
  background:rgba(15,23,42,.7);
  color:#e5eefc;
  min-height:34px;
  padding:0 12px;
  border-radius:11px;
  font-weight:800;
  font-size:12px;
  letter-spacing:.01em;
  cursor:pointer;
  transition:transform .16s ease, border-color .16s ease, background .16s ease;
}
.dx-software-workbar-v208 .dx-soft-btn-v208:hover{
  transform:translateY(-1px);
  border-color:rgba(59,130,246,.52);
  background:rgba(30,64,175,.32);
}
.dx-software-workbar-v208 .dx-soft-btn-v208.primary{
  border-color:rgba(34,197,94,.42);
  background:linear-gradient(135deg, rgba(34,197,94,.32), rgba(14,165,233,.18));
}
.dx-software-workbar-v208 .dx-soft-btn-v208.install{
  display:none;
  border-color:rgba(99,102,241,.45);
  background:rgba(79,70,229,.24);
}
.dx-software-workbar-v208 .dx-soft-btn-v208.install.is-visible{
  display:inline-flex;
  align-items:center;
}
.dx-software-workbar-v208 .dx-soft-separator-v208{
  width:1px;
  height:24px;
  background:rgba(148,163,184,.18);
  margin:0 2px;
}
.dx-software-workbar-system-v208{
  color:var(--dx-soft-muted);
  font-size:12px;
  white-space:nowrap;
}
.dx-software-workbar-system-v208 span{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:0 9px;
  border:1px solid rgba(148,163,184,.16);
  border-radius:999px;
  background:rgba(15,23,42,.45);
}

.dx-software-statusbar-v208{
  position:fixed;
  left:var(--dx-soft-sidebar);
  right:0;
  bottom:0;
  min-height:var(--dx-soft-status);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 16px;
  border-top:1px solid var(--dx-soft-border);
  background:rgba(3, 7, 18, .92);
  color:rgba(226,232,240,.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index:80;
  font-size:12px;
  line-height:1;
}
.dx-software-status-left-v208,
.dx-software-status-right-v208{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.dx-software-statusbar-v208 b{
  color:#f8fafc;
  font-weight:900;
}
.dx-software-statusbar-v208 .dot-v208{
  width:7px;
  height:7px;
  border-radius:999px;
  background:#64748b;
  box-shadow:0 0 0 4px rgba(100,116,139,.15);
}
.dx-software-statusbar-v208.is-live .dot-v208{
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.15), 0 0 16px rgba(34,197,94,.55);
}
.dx-software-statusbar-v208 span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.dx-software-install-toast-v210{
  position:fixed;
  right:18px;
  bottom:calc(var(--dx-soft-status) + 16px);
  z-index:100;
  width:min(360px, calc(100vw - 32px));
  border:1px solid rgba(148,163,184,.22);
  border-radius:20px;
  background:rgba(8,13,26,.94);
  box-shadow:0 24px 70px rgba(0,0,0,.34);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  padding:16px;
  color:#f8fafc;
  display:none;
}
.dx-software-install-toast-v210.is-visible{display:block; animation:dxSoftToastIn .26s ease both;}
.dx-software-install-toast-v210 strong{display:block;font-size:15px;margin-bottom:4px;}
.dx-software-install-toast-v210 p{margin:0 0 12px;color:rgba(226,232,240,.68);font-size:13px;line-height:1.4;}
.dx-software-install-toast-actions-v210{display:flex;gap:8px;justify-content:flex-end;}
@keyframes dxSoftToastIn{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}

/* Desktop software window */
@media (min-width: 981px){
  body.dx-software-shell-active[data-page="home"]{
    overflow:hidden;
  }
  body.dx-software-shell-active[data-page="home"] .beta-banner{
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:90;
    min-height:30px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:4px 14px;
    font-size:11px;
    letter-spacing:.12em;
    text-transform:uppercase;
    border-bottom:1px solid rgba(148,163,184,.18);
  }
  body.dx-software-shell-active[data-page="home"] .diagnostix-app-shell{
    height:calc(100dvh - 30px);
    margin-top:30px;
    display:grid;
    grid-template-columns:var(--dx-soft-sidebar) minmax(0, 1fr);
    overflow:hidden;
  }
  body.dx-software-shell-active[data-page="home"] .app-sidebar-v2,
  body.dx-software-shell-active[data-page="home"] .discord-sidebar{
    height:calc(100dvh - 30px);
    max-height:calc(100dvh - 30px);
    overflow:auto;
    border-right:1px solid var(--dx-soft-border);
    box-shadow:inset -1px 0 0 rgba(255,255,255,.03);
  }
  body.dx-software-shell-active[data-page="home"] .diagnostix-main-v2{
    min-width:0;
    min-height:0;
    height:calc(100dvh - 30px);
    display:grid;
    grid-template-rows:auto auto minmax(0, 1fr);
    overflow:hidden;
  }
  body.dx-software-shell-active[data-page="home"] .app-topbar-v2{
    position:relative;
    top:auto;
    margin:0;
    border-radius:0;
    min-height:var(--dx-soft-top);
  }
  body.dx-software-shell-active[data-page="home"] .main-layout{
    min-height:0;
    height:auto;
    overflow:auto;
    padding-bottom:calc(var(--dx-soft-status) + 24px) !important;
    scrollbar-width:thin;
  }
  body.dx-software-shell-active[data-page="home"] .app-page.is-active{
    animation:dxWorkbenchIn .18s ease both;
  }
  body.dx-software-shell-active[data-page="home"] .site-footer{
    display:none;
  }
  body.dx-software-shell-active[data-page="home"] .platform-hero-v96,
  body.dx-software-shell-active[data-page="home"] .platform-panel-v96,
  body.dx-software-shell-active[data-page="home"] .platform-metro-card-v96,
  body.dx-software-shell-active[data-page="home"] .panel,
  body.dx-software-shell-active[data-page="home"] .widget-card,
  body.dx-software-shell-active[data-page="home"] .diagnostic-legal-hint-v90,
  body.dx-software-shell-active[data-page="home"] .warning-card-v2,
  body.dx-software-shell-active[data-page="home"] .ios-bluefy-card,
  body.dx-software-shell-active[data-page="home"] .beta-inline-card{
    border:1px solid rgba(148,163,184,.18);
    box-shadow:0 18px 42px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.055);
  }
  body.dx-software-shell-active[data-page="home"] .platform-status-grid-v96,
  body.dx-software-shell-active[data-page="home"] .platform-card-grid-v96,
  body.dx-software-shell-active[data-page="home"] .info-grid,
  body.dx-software-shell-active[data-page="home"] .diagnostic-warning-grid-v2{
    gap:12px;
  }
  body.dx-software-shell-active[data-page="home"] .channel-item{
    border-radius:10px;
  }
  body.dx-software-shell-active[data-page="home"] .channel-item.is-active{
    box-shadow:inset 3px 0 0 rgba(34,197,94,.9), 0 8px 22px rgba(0,0,0,.18);
  }
  @keyframes dxWorkbenchIn{from{opacity:.74;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
}

/* Tablet / Mobile: keep existing app behavior, only add compact software control strip */
@media (max-width: 980px){
  .dx-software-workbar-v208{
    position:sticky;
    top:0;
    flex-wrap:wrap;
    padding:9px 12px;
    border-radius:0 0 18px 18px;
    margin:0 8px 8px;
  }
  .dx-software-workbar-actions-v208{
    width:100%;
    overflow-x:auto;
    padding-bottom:2px;
    -webkit-overflow-scrolling:touch;
  }
  .dx-software-workbar-v208 .dx-soft-btn-v208{
    flex:0 0 auto;
    min-height:32px;
    padding:0 10px;
  }
  .dx-software-workbar-system-v208{
    display:none;
  }
  .dx-software-statusbar-v208{
    left:8px;
    right:8px;
    bottom:calc(72px + env(safe-area-inset-bottom));
    min-height:32px;
    border-radius:999px;
    padding:0 12px;
    font-size:11px;
    pointer-events:none;
  }
  .dx-software-status-right-v208{display:none;}
  .dx-software-install-toast-v210{
    right:12px;
    bottom:calc(120px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px){
  .dx-software-module-text-v208 small{display:none;}
  .dx-software-module-text-v208 strong{font-size:13px;max-width:180px;}
  .dx-software-statusbar-v208 span:nth-child(n+4){display:none;}
}


/* v230 hotfix: profile/storage text must never stretch the bottom software statusbar. */
.dx-software-statusbar-v208{
  overflow:hidden !important;
}
.dx-software-status-left-v208{
  flex:1 1 auto !important;
  min-width:0 !important;
  overflow:hidden !important;
}
.dx-software-status-right-v208{
  flex:0 1 auto !important;
  min-width:0 !important;
  max-width:min(42vw, 360px) !important;
  overflow:hidden !important;
}
.dx-software-statusbar-v208 span,
#dxSoftwareStorage,
#dxSoftwareVersion{
  display:inline-block !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  vertical-align:middle !important;
}
#dxSoftwareStorage{
  max-width:min(22vw, 180px) !important;
}
#chipStorage.status-chip,
#chipStorage.status-chip.mini{
  max-width:180px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  flex:0 1 auto !important;
}
@media(max-width:760px){
  #dxSoftwareStorage{max-width:110px !important;}
  #chipStorage.status-chip,
  #chipStorage.status-chip.mini{max-width:130px !important;}
}
