/* PWA controls are isolated from form and modal styling. */
#jx-pwa-install { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
#jx-pwa-install .jx-pwa-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 32px; border: 1px solid #cad9f2; border-radius: 10px;
  background: #f7faff; color: #2057af; padding: 5px 12px;
  font: 600 12px/1.3 system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  cursor: pointer; white-space: nowrap; transition: background .16s, transform .16s, box-shadow .16s;
}
#jx-pwa-install .jx-pwa-action:hover { background: #e9f1ff; transform: translateY(-1px); box-shadow: 0 4px 10px #1a56b61a; }
#jx-pwa-install .jx-pwa-action:active { transform: scale(.97); }
#jx-pwa-update {
  box-sizing: border-box; position: fixed; bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%); z-index: 30000;
  width: min(550px, calc(100vw - 24px)); display: flex; gap: 10px; align-items: center;
  padding: 13px; background: #fff; color: #243b62; border: 1px solid #d5e2f5;
  border-radius: 16px; box-shadow: 0 18px 50px #112a4b30;
  font: 13px/1.4 system-ui, -apple-system, "Microsoft YaHei", sans-serif;
}
#jx-pwa-update .jx-pwa-update-indicator { width: 9px; height: 9px; border-radius: 50%; background: #2975e7; flex: none; }
#jx-pwa-update .jx-pwa-update-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
#jx-pwa-update .jx-pwa-update-text strong { font-weight: 750; }
#jx-pwa-update .jx-pwa-update-text small { color: #74839a; font-size: 11px; }
#jx-pwa-update button { border-radius: 9px; font: 600 12px/1.3 system-ui, -apple-system, "Microsoft YaHei", sans-serif; padding: 9px 11px; cursor: pointer; white-space: nowrap; }
#jx-pwa-update .jx-pwa-update-later { color: #435c83; border: 1px solid #d4e0ef; background: #fff; }
#jx-pwa-update .jx-pwa-update-now { color: white; border: 1px solid #2466d4; background: #2466d4; }
#jx-pwa-update button:disabled { opacity: .6; cursor: default; }
#jx-pwa-help {
  box-sizing: border-box; position: fixed; bottom: max(64px, env(safe-area-inset-bottom));
  right: 12px; z-index: 30001; width: min(345px, calc(100vw - 24px));
  padding: 17px 18px; border: 1px solid #d3e1f3; border-radius: 16px;
  background: #fff; color: #2b4163; box-shadow: 0 16px 42px #162c492e;
  font: 13px/1.7 system-ui, -apple-system, "Microsoft YaHei", sans-serif;
}
#jx-pwa-help p { margin: 10px 0 0; }
#jx-pwa-help .jx-pwa-help-note { color: #7889a0; font-size: 11px; }
@media (max-width: 520px) {
  #jx-pwa-update { flex-wrap: wrap; }
  #jx-pwa-update .jx-pwa-update-text { flex-basis: calc(100% - 25px); }
  #jx-pwa-update .jx-pwa-update-later { margin-left: auto; }
  #jx-pwa-install .jx-pwa-action { padding-inline: 7px; }
  #jx-pwa-install .jx-pwa-action svg { width: 15px; }
  .ws-header-right #jx-pwa-install .jx-pwa-action { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  #jx-pwa-install .jx-pwa-action { transition: none; }
}

/* The native macOS/Windows traffic lights remain browser-owned. Only in
   installed desktop Chrome/Edge with Window Controls Overlay do we extend
   our light ERP shell into the title bar; regular browser windows unchanged. */
html.jx-pwa-wco-active {
  --jx-pwa-bar-height: env(titlebar-area-height, 36px);
}
html.jx-pwa-wco-active body {
  padding-top: var(--jx-pwa-bar-height) !important;
  box-sizing: border-box;
}
#jx-pwa-titlebar {
  position: fixed; inset: 0 0 auto;
  height: var(--jx-pwa-bar-height); width: 100%;
  z-index: 1000; box-sizing: border-box;
  display: flex; align-items: center;
  /* This is native app chrome, not themed page content. Keep one stable
     light tint so autumn/dark skins never create a brown/black patch beside
     macOS traffic lights and Chromium's own titlebar controls. */
  background: #fafcff;
  border-bottom: 1px solid #e2ebf7;
  color: #56677e;
  color-scheme: light;
  -webkit-app-region: drag;
  app-region: drag;
  user-select: none;
}
#jx-pwa-titlebar .jx-pwa-titlebar-safe {
  position: absolute;
  left: env(titlebar-area-x, 0px);
  top: 0;
  width: env(titlebar-area-width, 100%);
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .01em; pointer-events: none;
}
/* Sticky top navigation and sidebar must stay below the OS window controls. */
html.jx-pwa-wco-active .ws-sidebar {
  top: var(--jx-pwa-bar-height);
  height: calc(100dvh - var(--jx-pwa-bar-height));
}
html.jx-pwa-wco-active .ws-header { top: var(--jx-pwa-bar-height); }
html.jx-pwa-wco-active .ws-layout { min-height: calc(100dvh - var(--jx-pwa-bar-height)); }
/* The PWA titlebar is always neutral irrespective of system/theme darkness.
   The platform owns the native close/minimize/maximize buttons. */

@media (max-width: 395px) {
  .ws-header-right #jx-pwa-install .jx-pwa-action { padding: 7px 9px; }
  .ws-header-right #jx-pwa-install .jx-pwa-action span { display: none; }
}


/* Unified cross-device installer. One install entrance, no full-screen blocks until clicked. */
.jx-nav #jx-pwa-install { margin-left:auto; }
.jx-nav #jx-pwa-install .jx-pwa-action { font-size:12px; background:#f4f8ff; }
.jx-pwa-help-mask { position:fixed; inset:0; z-index:31000; display:flex;
  justify-content:center; align-items:center; padding:18px;
  background:rgba(13,29,54,.32); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); }
#jx-pwa-help { position:relative; inset:auto; width:min(450px,100%); max-height:min(720px,calc(100dvh - 36px)); overflow:auto;
  border-radius:22px; padding:27px 29px 24px; border:1px solid rgba(217,228,243,.85);
  background:#fff; color:#213a59; box-shadow:0 28px 88px rgba(10,33,65,.22);
  font:14px/1.7 -apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',system-ui,sans-serif; }
#jx-pwa-help .jx-pwa-help-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
#jx-pwa-help .jx-pwa-help-kicker { font:700 10px/1.4 system-ui,sans-serif; letter-spacing:.16em; color:#8b9db3; }
#jx-pwa-help .jx-pwa-help-close { width:32px; height:32px; border:0; background:transparent; color:#8799ae;
  border-radius:50%; font-size:22px; line-height:1; cursor:pointer; }
#jx-pwa-help .jx-pwa-help-close:hover { background:#f0f4fa; color:#305c8e; }
#jx-pwa-help h2 { margin:7px 0 0; font-size:24px; letter-spacing:-.5px; font-weight:720; }
#jx-pwa-help .jx-pwa-help-platform { display:inline-block; margin:10px 0 0; font-size:11px; font-weight:650;
  padding:3px 10px; border-radius:20px; background:#edf5ff; color:#2e66b5; }
#jx-pwa-help .jx-pwa-help-summary { margin:17px 0 20px; color:#697f99; font-size:13px; }
#jx-pwa-help .jx-pwa-help-section-title { margin:0 0 8px; color:#233e5d; font-size:13px; font-weight:720; }
#jx-pwa-help .jx-pwa-help-steps { list-style:none; counter-reset:install-step; margin:0; padding:0; }
#jx-pwa-help .jx-pwa-help-steps li { counter-increment:install-step; display:flex; align-items:flex-start;
  gap:12px; padding:12px 0; border-bottom:1px solid #eef1f6; font-size:13px; color:#47617f; }
#jx-pwa-help .jx-pwa-help-steps li::before { content:counter(install-step); flex:none; display:grid; place-items:center;
  width:23px; height:23px; border-radius:8px; background:#edf4fd; color:#2767ba; font:700 11px/1 system-ui; }
#jx-pwa-help .jx-pwa-help-note { margin:16px 0; font-size:11px; color:#8798ab; line-height:1.65; }
#jx-pwa-help .jx-pwa-help-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:10px; }
#jx-pwa-help .jx-pwa-help-actions button { min-height:39px; padding:9px 16px; border-radius:10px; cursor:pointer;
  font:600 12px/1.3 system-ui,-apple-system,sans-serif; }
#jx-pwa-help .jx-pwa-help-done { background:#286fd5; color:#fff; border:1px solid #286fd5; }
#jx-pwa-help .jx-pwa-help-shortcut { background:#fff; color:#3d6496; border:1px solid #d5e2ef; margin-right:auto; }
#jx-pwa-help button:focus-visible { outline:2px solid #5d97e6; outline-offset:3px; }
@media(max-width:540px) { .jx-nav #jx-pwa-install { margin-left:0; }
  #jx-pwa-help { padding:20px; border-radius:18px; }
  #jx-pwa-help h2 { font-size:21px; }
  #jx-pwa-help .jx-pwa-help-actions { flex-direction:column; align-items:stretch; }
  #jx-pwa-help .jx-pwa-help-actions button { width:100%; }
  #jx-pwa-help .jx-pwa-help-shortcut { margin-right:0; } }
@media(prefers-reduced-motion:reduce){.jx-pwa-help-mask{backdrop-filter:none;-webkit-backdrop-filter:none;}}

/* Mobile install guidance: a real path through WeChat -> Safari/Chrome,
   not a dead-end HTTPS warning. Shared across themes, colors are token-based. */
#jx-pwa-help .jx-pwa-address {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center;
  gap:8px; margin:8px 0 17px; padding:7px; border:1px solid var(--jx-ui-border,#e0e9f3);
  border-radius:12px; background:var(--jx-ui-soft,#f5f8fc);
}
#jx-pwa-help .jx-pwa-address-value {
  box-sizing:border-box; min-width:0; width:100%; padding:7px 5px;
  border:0; outline:none; background:transparent; color:var(--jx-ui-text,#284663);
  font:500 12px/1.45 system-ui,-apple-system,sans-serif;
  text-overflow:ellipsis;
}
#jx-pwa-help .jx-pwa-copy-address {
  min-height:36px; padding:7px 11px; border:1px solid var(--jx-ui-border,#c9dcf5);
  border-radius:9px; background:var(--jx-ui-surface,#fff); color:var(--jx-ui-accent,#286fd5);
  cursor:pointer; white-space:nowrap; font:600 12px/1.3 system-ui,sans-serif;
}
#jx-pwa-help .jx-pwa-copy-address:hover { filter:brightness(.97); }
#jx-pwa-help .jx-pwa-copy-status {
  grid-column:1/-1; min-height:0; padding:0 6px; font-size:11px;
  color:var(--jx-ui-accent,#286fd5);
}
#jx-pwa-help .jx-pwa-copy-status:empty {display:none;}
#jx-pwa-help .jx-pwa-help-close {display:grid;place-items:center;flex:none;}
#jx-pwa-help .jx-pwa-help-close svg {display:block;}
#jx-pwa-help .jx-pwa-help-steps li {min-width:0; overflow-wrap:anywhere;}
@media(max-width:540px) {
  .jx-pwa-help-mask {padding:max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));}
  #jx-pwa-help {width:100%;max-height:calc(100dvh - 20px);padding:19px 18px 18px;}
  #jx-pwa-help .jx-pwa-help-summary {margin:10px 0 13px;}
  #jx-pwa-help .jx-pwa-help-steps li {padding:10px 0;line-height:1.6;}
}
@media(prefers-reduced-motion:reduce) {
  #jx-pwa-help .jx-pwa-copy-address {transition:none;}
}

/* Header cannot inherit decorative hero/photo themes or draw over native controls. */
html.jx-pwa-wco-active #jx-pwa-titlebar{
  background:#fafcff!important;color:#56677e!important;
  border-bottom-color:#e2ebf7!important;
  box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  transition:background-color 200ms ease,border-color 200ms ease;
}
html.jx-pwa-wco-active #jx-pwa-titlebar .jx-pwa-titlebar-safe{
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
@media(prefers-reduced-motion:reduce){html.jx-pwa-wco-active #jx-pwa-titlebar{transition:none!important}}

/* Spring PWA is part of the ERP theme, not a second blue-only micro-UI. */
html[data-theme="spring"] #jx-pwa-install .jx-pwa-action,
html[data-theme="spring"] .jx-nav #jx-pwa-install .jx-pwa-action{
 color:var(--jx-spring-control-ink,#315940)!important;
 border-color:var(--jx-spring-control-border,#c9dcc5)!important;
 background:var(--jx-spring-control,linear-gradient(145deg,#fffefa,#eef7e9))!important;
 box-shadow:0 2px 8px #345e3a10,inset 0 1px #fff!important;
 border-radius:11px;
}
html[data-theme="spring"] #jx-pwa-install .jx-pwa-action:hover:not(:disabled){
 color:#28513a!important;background:var(--jx-spring-control-hover,linear-gradient(145deg,#fffefa,#e8f4e4))!important;
 border-color:#a9c9a5!important;box-shadow:0 4px 12px #345e3a1d,inset 0 1px #fff!important;
}
html[data-theme="spring"] :is(#jx-pwa-update,#jx-pwa-help){
 background:var(--jx-spring-paper,#fffef9);
 border-color:var(--jx-border);color:var(--jx-ink);box-shadow:var(--jx-shadow-float);
}
html[data-theme="spring"] :is(#jx-pwa-update .jx-pwa-update-indicator,#jx-pwa-help .jx-pwa-help-done,
#jx-pwa-help .jx-pwa-help-steps li::before){background:#4b8057;color:#fff;}
html[data-theme="spring"] :is(#jx-pwa-update .jx-pwa-update-now,#jx-pwa-help .jx-pwa-help-done){
 background:var(--jx-spring-primary);border-color:var(--jx-spring-primary-border);color:#fff;
}
html[data-theme="spring"] :is(#jx-pwa-update .jx-pwa-update-later,#jx-pwa-help .jx-pwa-help-shortcut){
 background:var(--jx-spring-paper);border-color:var(--jx-spring-control-border);color:var(--jx-spring-control-ink);
}
html[data-theme="spring"] :is(#jx-pwa-help .jx-pwa-help-section-title,
#jx-pwa-help h2){color:#315940;}
html[data-theme="spring"] :is(#jx-pwa-help .jx-pwa-help-platform){background:#e7f3e2;color:#3f764e;}
html[data-theme="spring"] :is(#jx-pwa-help .jx-pwa-help-kicker,#jx-pwa-help .jx-pwa-help-note,
#jx-pwa-help .jx-pwa-help-summary){color:var(--jx-muted);}
html[data-theme="spring"] :is(#jx-pwa-help .jx-pwa-help-steps li){border-color:#e1ebdd;color:#48684d;}
html[data-theme="spring"] :is(#jx-pwa-help .jx-pwa-help-close){color:#6e8f74;background:#eef7e9;}
html[data-theme="spring"] :is(#jx-pwa-help .jx-pwa-help-close:hover){color:#315940;background:#e1f0dd;}

/* Complete iPhone installation screenshots, privacy redacted and action highlighted. */
#jx-pwa-help .jx-pwa-help-steps li { align-items:flex-start; }
#jx-pwa-help .jx-pwa-step-content { min-width:0; flex:1; display:grid; gap:8px; }
#jx-pwa-help .jx-pwa-step-text { display:block; line-height:1.65; }
#jx-pwa-help .jx-pwa-step-zoom { width:100%; display:flex; flex-direction:column; align-items:center;
  gap:7px; padding:7px; border:1px solid var(--jx-ui-border,#dce6f3);
  background:var(--jx-ui-soft,#f5f8fc); border-radius:12px;
  color:var(--jx-ui-text,#3a5475); cursor:zoom-in; box-sizing:border-box; }
#jx-pwa-help .jx-pwa-step-zoom img {
  display:block;width:100%;max-width:100%;height:auto;max-height:none;
  object-fit:contain;border-radius:9px;aspect-ratio:auto;
}
#jx-pwa-help .jx-pwa-step-zoom small { font-size:11px; font-weight:550; opacity:.78; }
#jx-pwa-help .jx-pwa-step-zoom:focus-visible { outline:2px solid var(--jx-ui-accent,#286fd5);outline-offset:3px; }
#jx-pwa-help .jx-pwa-step-preview {position:fixed;inset:0;z-index:31005;display:flex;
  align-items:center;justify-content:center;padding:68px 18px 24px;box-sizing:border-box;
  background:rgba(15,28,49,.88);cursor:zoom-out;}
#jx-pwa-help .jx-pwa-step-preview img {max-width:min(94vw,660px);max-height:calc(100dvh - 110px);
  width:auto;height:auto;object-fit:contain;border-radius:12px;box-shadow:0 18px 45px #0004;}
#jx-pwa-help .jx-pwa-preview-close {position:absolute;top:max(15px,env(safe-area-inset-top));right:18px;
  border:1px solid #ffffff50;border-radius:999px;color:white;background:#ffffff20;
  padding:9px 15px;cursor:pointer;font:600 13px/1.3 system-ui,sans-serif;}
@media(prefers-reduced-motion:reduce){#jx-pwa-help .jx-pwa-step-zoom{transition:none;}}

/* V2.8.8: focused, refined illustrated iPhone installation wizard.
   Accent colors continue to follow theme tokens. The red markers live only
   inside the five privacy-redacted screenshots. */
#jx-pwa-help.jx-pwa-help--wizard{width:min(520px,100%);}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-help-section-title{
  margin:15px 0 8px;font-size:14px;letter-spacing:.01em;
}
#jx-pwa-help .jx-pwa-guide-progress{margin:12px 0 6px;}
#jx-pwa-help .jx-pwa-guide-progress-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;
  font-size:12px;color:var(--jx-ui-muted,#69829a);}
#jx-pwa-help .jx-pwa-guide-progress-header strong{color:var(--jx-ui-text,#34526e);font-size:12px;font-weight:670;}
#jx-pwa-help .jx-pwa-guide-progress-value{font-variant-numeric:tabular-nums;letter-spacing:.09em;font-weight:740;
  color:var(--jx-ui-accent,#286fd5)}
#jx-pwa-help .jx-pwa-guide-track{height:4px;border-radius:20px;background:var(--jx-ui-border,#e5ecf5);overflow:hidden;}
#jx-pwa-help .jx-pwa-guide-fill{display:block;height:100%;background:var(--jx-ui-accent,#286fd5);
  border-radius:20px;transition:width .22s ease;}
#jx-pwa-help .jx-pwa-help-steps li[hidden]{display:none!important;}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-help-steps li{border-bottom:0;padding:10px 0 4px;}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-help-steps li::before{display:none;}
#jx-pwa-help .jx-pwa-step-name{font-size:18px;line-height:1.35;font-weight:760;
  margin:0;color:var(--jx-ui-text,#233c58);}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-step-text{font-size:13px;line-height:1.7;
  color:var(--jx-ui-muted,#617992);margin:0 0 4px;}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-step-zoom{margin-top:7px;border:0;border-radius:18px;
  padding:14px 13px 10px;background:var(--jx-ui-soft,#f4f7fc);box-shadow:inset 0 0 0 1px var(--jx-ui-border,#e4ebf4);}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-step-zoom img{width:100%;max-width:310px;
  height:auto;max-height:none;object-fit:contain;aspect-ratio:auto;border-radius:13px;
  box-shadow:0 10px 30px rgba(23,40,66,.10);}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-step-zoom small{color:var(--jx-ui-muted,#72859a);font-size:11px;opacity:1;}
#jx-pwa-help .jx-pwa-guide-controls{display:grid;grid-template-columns:1fr 1.45fr;gap:10px;
  padding:12px 0 4px;}
#jx-pwa-help .jx-pwa-guide-controls button{min-height:43px;border-radius:11px;padding:10px 12px;
  font:650 13px/1.4 system-ui,-apple-system,sans-serif;cursor:pointer;}
#jx-pwa-help .jx-pwa-step-prev{border:1px solid var(--jx-ui-border,#d9e4ef);
  color:var(--jx-ui-text,#3b5978);background:var(--jx-ui-surface,#fff);}
#jx-pwa-help .jx-pwa-step-prev:disabled{opacity:.38;cursor:default;}
#jx-pwa-help .jx-pwa-step-next{border:1px solid var(--jx-ui-accent,#286fd5);
  color:#fff;background:var(--jx-ui-accent,#286fd5);}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-help-note{font-size:11px;line-height:1.7;margin:12px 0;color:var(--jx-ui-muted,#8698a9);}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-help-actions{margin-top:4px;}
@media(max-width:540px){
  #jx-pwa-help.jx-pwa-help--wizard{padding:20px 19px 17px;}
  #jx-pwa-help.jx-pwa-help--wizard .jx-pwa-step-zoom{padding:12px;}
  #jx-pwa-help .jx-pwa-guide-controls{grid-template-columns:1fr 1.3fr;}
}
@media(prefers-reduced-motion:reduce){#jx-pwa-help .jx-pwa-guide-fill{transition:none;}}

/* Wizard has its own completion action and a close icon; avoid duplicate footer. */
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-help-section-title{display:none}
#jx-pwa-help.jx-pwa-help--wizard .jx-pwa-help-actions{display:none}
