/* A small upward disclosure on desktop; a reachable bottom sheet on phones. */
.mobile-help-entry { font-size:12px; color:#6e7078; }
.login-mobile-entry { display:flex; align-items:center; width:fit-content; min-height:44px; margin:8px auto 0; padding:0 12px; border:0; border-radius:8px; color:#315f4a; font-size:13px; }
.login-mobile-entry:hover { background:#eaf2e8; }
.first-install-guide { position:relative; margin:0 0 20px; padding:14px 16px; border:1px solid #cadcc8; border-radius:14px; background:#eff5ed; color:var(--text); }
.first-install-copy h2 { margin:0; font-size:15px; font-weight:650; }
.first-install-copy p { margin:6px 0 0; color:var(--muted); font-size:13px; line-height:1.6; }
#first-install-download { display:inline-flex; align-items:center; min-height:44px; margin-top:12px; padding:8px 14px; border-radius:9px; font-size:13px; }
.first-install-guide .mobile-help-steps { margin-top:14px; gap:10px; }
.first-install-guide .mobile-help-steps p { margin-top:2px; color:var(--muted); font-size:12px; }
.first-install-arrow { display:none; position:absolute; top:14px; right:16px; width:24px; height:24px; color:#315f4a; transform:rotate(35deg); }
.first-install-guide[data-platform="wechat"] .first-install-arrow { display:block; }
.first-install-guide[data-platform="wechat"] .first-install-copy { padding-right:32px; }
.sidebar .sidebar-utility.mobile-help-entry {
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:60px;
  margin:0 0 12px;
  padding:9px 10px;
  border:1px solid #426050;
  border-radius:12px;
  background:#1d4033;
  text-align:left;
}
.sidebar .sidebar-utility.mobile-help-entry:hover { background:#274c3c; border-color:#6a8c71; }
.mobile-entry-icon,.mobile-help-icon {
  display:grid;
  flex:none;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:9px;
}
.mobile-entry-icon { background:#335747; color:var(--lime); }
.mobile-entry-copy { display:grid; flex:1; min-width:0; gap:3px; line-height:1.35; }
.mobile-entry-copy strong { color:#f4f9f3; font-size:13px; font-weight:650; }
.mobile-entry-copy small { color:var(--forest-muted); font-size:11px; }
.mobile-entry-chevron { width:15px; height:15px; color:#b4cbbc; }
.topbar-actions { display:flex; align-items:center; gap:8px; flex:none; }
.topbar-mobile-help { min-height:36px; padding:7px 8px; border:1px solid #e5e5e9; background:#fff; border-radius:8px; white-space:nowrap; }
#mobile-help { position:fixed; top:auto; right:auto; bottom:110px; left:16px; margin:0; width:352px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain; padding:23px; border:1px solid #e2e3e8; border-radius:18px; background:#fff; color:#30343c; box-shadow:0 14px 55px #1e233223,0 2px 8px #1e23320a; }
#mobile-help[open] { animation:mobile-help-rise .18s ease-out; }
#mobile-help::backdrop { background:#102d252c; backdrop-filter:none; }
.mobile-help-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.mobile-help-heading-content { display:flex; align-items:center; min-width:0; gap:11px; }
.mobile-help-icon { width:40px; height:40px; background:#e6f1e3; color:#28573f; }
#mobile-help-title { margin:0; font-size:20px; font-weight:620; letter-spacing:-.5px; line-height:1.4; }
#mobile-help .icon-button { width:34px; min-height:34px; padding:7px; margin:-5px -6px 0 0; color:#8a8d96; }
#mobile-help-intro { margin:11px 0 17px; color:#777c86; font-size:12px; line-height:1.7; }
.mobile-help-account {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:14px;
  margin:0 0 14px;
  padding:10px 12px;
  border:1px solid #dce8da;
  border-radius:10px;
  background:#f3f7f0;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}
.mobile-help-account strong { color:var(--text); font-weight:620; text-align:right; overflow-wrap:anywhere; }
.mobile-help-qr { display:grid; place-items:center; width:fit-content; min-height:192px; margin:0 auto 17px; border:1px solid #e9eaed; border-radius:14px; padding:7px; background:#fff; }
#mobile-qr { display:block; width:176px; height:176px; }
#mobile-qr-error { font-size:12px; color:#878b95; max-width:180px; padding:16px; text-align:center; }
.mobile-help-platforms { display:flex; gap:3px; padding:3px; margin:0 0 17px; background:#f3f3f5; border-radius:9px; }
.mobile-help-platforms button { flex:1; min-height:32px; padding:5px 10px; font-size:12px; border-radius:7px; color:#858993; }
.mobile-help-platforms button[aria-pressed="true"] { background:#fff; color:#343840; box-shadow:0 1px 4px #1721340e; }
.mobile-help-steps { list-style:none; counter-reset:mobile-step; display:grid; gap:15px; padding:0; margin:0; }
.mobile-help-steps li { position:relative; padding-left:30px; counter-increment:mobile-step; }
.mobile-help-steps li::before { content:counter(mobile-step); display:grid; place-items:center; position:absolute; left:0; top:1px; width:19px; height:19px; border:1px solid #e1e3e8; border-radius:50%; font-size:10px; color:#858b95; font-variant-numeric:tabular-nums; }
.mobile-help-steps strong { font-size:12px; font-weight:580; }
.mobile-help-steps p { margin:4px 0 0; font-size:11.5px; line-height:1.8; color:#80858f; overflow-wrap:anywhere; }
.mobile-help-note { font-size:10.5px; line-height:1.75; margin:17px 0 13px; color:#969ba4; }
.mobile-help-link { display:flex; align-items:center; gap:8px; margin-top:14px; border-top:1px solid var(--line); padding-top:8px; }
#mobile-help-address { min-width:0; flex:1; font-size:10px; color:#9096a1; overflow-wrap:anywhere; user-select:text; }
.mobile-help-link button { display:inline-flex; align-items:center; gap:7px; flex:none; padding:7px 8px; min-height:36px; font-size:12px; color:#315f4a; }
.mobile-help-link button svg { width:15px; height:15px; }
.mobile-help-feedback { font-size:11px; color:#737b88; line-height:1.65; margin:8px 0 0; }
.mobile-help-feedback:empty { display:none; }
#mobile-help-install { margin-top:20px; min-height:44px; font-size:13px; }
@keyframes mobile-help-rise { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@media (max-width:700px) {
  #mobile-help { left:0; right:0; bottom:0; top:auto; width:100%; max-width:100%; max-height:calc(100dvh - 32px); padding:26px 24px max(26px,env(safe-area-inset-bottom)); border-radius:22px 22px 0 0; border-bottom:0; }
  #mobile-help::backdrop { background:#1f26364d; }
  #mobile-help::before { content:''; position:absolute; width:30px; height:4px; background:#dfe1e6; border-radius:5px; top:9px; left:calc(50% - 15px); }
  #mobile-help-title { font-size:21px; }
  #mobile-help-intro { font-size:13px; }
  .mobile-help-steps { gap:20px; margin-top:23px; }
  .mobile-help-steps strong { font-size:14px; }
  .mobile-help-steps p { font-size:12.5px; }
  .mobile-help-note { font-size:11.5px; margin-top:22px; }
  .mobile-help-link button { min-height:44px; }
}
@media (prefers-reduced-motion:reduce) { #mobile-help[open] { animation:none; } }

#generate-mobile-login { display:flex; align-items:center; justify-content:center; gap:8px; min-height:46px; margin:0 0 10px; border-radius:11px; font-size:13px; }
#generate-mobile-login svg { width:18px; height:18px; }
#mobile-login-account { font-weight:600; color:#30343c; }
#mobile-login-feedback { color:#94543d; font-size:13px; line-height:1.7; }
@media(max-width:720px), (max-width:1000px) and (max-height:500px) {
  #mobile-login-dialog button { min-height:44px; }
}

#mobile-connect-status { display:flex; align-items:center; gap:8px; min-height:44px; margin:0 0 14px; padding:10px 12px; border-radius:10px; background:#f3f4f6; color:#454c58; font-size:12px; }
#mobile-connect-status::before { content:''; flex:none; width:8px; height:8px; border-radius:50%; background:#9ba1ac; }
#mobile-connect-status[data-state="scanned"]::before, #mobile-connect-status[data-state="confirmed"]::before { background:#5378b5; }
#mobile-connect-status[data-state="connected"] { color:#286346; background:#edf6f0; }
#mobile-connect-status[data-state="connected"]::before { content:'✓'; display:grid; place-items:center; width:18px; height:18px; background:#286346; color:#fff; font-size:12px; }
#mobile-connect-status[data-state="error"], #mobile-connect-status[data-state="expired"], #mobile-connect-status[data-state="revoked"] { color:#825539; background:#faf3ec; }

#mobile-login-expiry { text-align:center; margin:-7px 0 14px; font-variant-numeric:tabular-nums; color:#737b88; }

#mobile-login-dialog .mobile-login-account { margin:20px 0; padding:18px; border:1px solid #e5e7ec; border-radius:12px; background:#f7f8fa; color:#30343c; font-size:20px; font-weight:600; overflow-wrap:anywhere; }
#mobile-login-success-text { color:#737b88; font-size:14px; line-height:1.75; }
#mobile-login-title:focus, #mobile-help-title:focus { outline:none; }
#mobile-login-dialog .icon-button { flex:none; }
.topbar-mobile-help { font-size:12px; }

/* Mobile handoff: one clear next action, quiet installation controls. */
#mobile-login-dialog { width:380px; padding:28px; border:1px solid #e6e7eb; border-radius:24px; box-shadow:0 20px 70px #20242f20; }
#mobile-login-dialog .dialog-head { align-items:center; gap:16px; }
#mobile-login-title { font-size:23px; letter-spacing:-.6px; font-weight:650; }
#mobile-login-dialog .icon-button, #mobile-help .icon-button { border:0; background:#f3f4f6; border-radius:50%; width:36px; min-height:36px; height:36px; padding:8px; margin:0; color:#737780; }
#mobile-login-description { font-size:14px; color:#747983; line-height:1.6; margin:12px 0 20px; }
#mobile-login-dialog .mobile-login-account { display:flex; align-items:center; gap:12px; margin:0 0 18px; padding:16px; border:0; border-radius:16px; font-size:17px; background:#f5f6f8; }
#mobile-login-account::before { content:'✓'; display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:50%; background:#e5ede8; color:#41735a; font-size:16px; }
#mobile-login-success-text { margin:0 0 22px; font-size:13px; line-height:1.7; }
#mobile-login-success { display:grid; gap:10px; }
#mobile-login-success button, #confirm-mobile-login, #retry-mobile-login { min-height:48px; border-radius:14px; font-size:14px; font-weight:550; }
#mobile-start-chat { display:flex; align-items:center; justify-content:center; gap:12px; background:#30343c; }
#mobile-success-install { background:#f3f4f6; border-color:transparent; color:#535a65; }
#mobile-login-feedback:empty { display:none; }
#mobile-help .mobile-help-heading { align-items:center; }
#mobile-help-title { font-size:22px; }
#mobile-help .mobile-help-steps { gap:10px; margin-top:18px; }
#mobile-help .mobile-help-steps li { padding:14px 14px 14px 48px; background:#f6f7f9; border-radius:14px; }
#mobile-help .mobile-help-steps li::before { top:15px; left:14px; width:23px; height:23px; border:0; background:#e8ebf0; color:#5b6471; font-size:11px; font-weight:600; }
#mobile-help .mobile-help-steps strong { font-size:14px; }
#mobile-help .mobile-help-steps p { margin-top:5px; font-size:12px; line-height:1.65; color:#757d88; }
#phone-mobile-help { display:inline-flex; align-items:center; gap:5px; min-height:36px; padding:7px 10px; border:0; border-radius:18px; background:#f0f2f5; color:#59616d; font-size:11px; font-weight:500; }
#phone-mobile-help svg { width:15px; height:15px; }
#phone-mobile-help:hover { background:#e8ebf0; }
#phone-mobile-help:focus:not(:focus-visible), #mobile-success-install:focus:not(:focus-visible) { outline:none; }
@media(max-width:700px) {
  #mobile-login-dialog { width:calc(100% - 32px); max-width:380px; padding:24px; }
  #mobile-help { padding:28px 22px max(22px,env(safe-area-inset-bottom)); border-radius:26px 26px 0 0; }
  #mobile-help .icon-button { width:44px; height:44px; min-height:44px; flex:none; }
  #mobile-help-intro { margin:10px 0 18px; }
  #mobile-help .mobile-help-note { margin:18px 0 12px; font-size:11px; }
  #mobile-help .mobile-help-link { padding-top:8px; }
}

/* Compact standalone startup; never imitate an available composer. */
.boot-chat-shell { display:none; }
.boot-progress { display:flex; flex-direction:column; align-items:center; gap:8px; }
@media(display-mode:standalone) {
  body[data-auth="checking"] #auth-screen { padding:0; background:#fafafa; }
  body[data-auth="checking"] .boot-state { width:100%; min-height:100dvh; padding:0 24px; justify-content:center; gap:32px; padding-bottom:8vh; }
  .boot-chat-shell { display:flex; flex-direction:column; align-items:center; gap:14px; color:#18191c; }
  .boot-chat-shell .brand-mark { width:56px; height:56px; }
  .boot-chat-shell strong { font-size:23px; font-weight:650; letter-spacing:-.7px; }
  .boot-caption { font-size:13px; color:#92959d; margin-top:-4px; }
  .boot-progress { flex-direction:row; gap:8px; font-size:12px; color:#8c9098; }
  .boot-progress p { margin:0; }
  .boot-progress .spinner { width:13px; height:13px; }
}

#mobile-help,#mobile-login-dialog { border-color:var(--line); color:var(--text); }
#mobile-help-intro,#mobile-login-description,#mobile-login-success-text { color:var(--muted); }
#mobile-help .mobile-help-steps li,#mobile-login-dialog .mobile-login-account { background:#eff5ed; }
#mobile-help .mobile-help-steps li::before,#mobile-login-account::before { background:#dfeadc; color:#345b43; }
#mobile-help .mobile-help-steps p,.mobile-help-note { color:#52665a; }
.mobile-help-note:empty { display:none; }
.mobile-help-badge { padding:2px 7px; border-radius:6px; background:#e7f1df; color:#264939; font-size:11px; }
#mobile-web-no-install { background:#f0f4ef; color:var(--muted); }
#toggle-android-download { display:flex; align-items:center; justify-content:center; gap:8px; min-height:46px; margin:0 0 10px; border-radius:11px; font-size:13px; }
#toggle-android-download, #generate-mobile-login { flex-wrap:wrap; }
.mobile-help-download-link:not([hidden]) { display:flex; align-items:center; min-height:44px; margin-top:8px; color:#315f4a; text-decoration:underline; text-underline-offset:.2em; }
#mobile-start-chat { background:var(--forest); }
#mobile-start-chat:hover { background:var(--accent); }
#mobile-success-install, #phone-mobile-help { background:#eaf2e8; color:#315642; }
#phone-mobile-help:hover { background:#e2eedf; }
