


body.ds-mobile .ds-mshell {
  height: 100%;
  display: flex;
  flex-direction: column;
  
  padding-top: env(safe-area-inset-top);
}

body.ds-mobile .ds-mtop {
  flex: 0 0 auto;
  height: 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 16px;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-line);
  position: relative; z-index: 40;   
}
body.ds-mobile .ds-mtop-title {
  flex: 1; min-width: 0;
  font-size: 16px; font-weight: 600; letter-spacing: -.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

body.ds-mobile .ds-mtop-menu {
  width: 44px; height: 44px; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; border-radius: 10px;
  color: var(--ds-ink2);
  -webkit-tap-highlight-color: transparent;
}
body.ds-mobile .ds-mtop-menu.is-open { background: var(--ds-line2); color: var(--ds-ink); }

body.ds-mobile .ds-mmain { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; }


body.ds-mobile .ds-mnav {
  flex: 0 0 auto;
  display: flex; align-items: stretch;
  background: var(--ds-surface);
  border-top: 1px solid var(--ds-line);
  padding-bottom: env(safe-area-inset-bottom);
  position: relative; z-index: 40;
}
body.ds-mobile .ds-mnav-item {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 56px; padding: 0 2px;
  color: var(--ds-muted2); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

body.ds-mobile .ds-mnav-label {
  font-size: 10.5px; font-weight: 500; letter-spacing: -.1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
body.ds-mobile .ds-mnav-item.active { color: var(--ds-ink); }

body.ds-mobile .ds-mnav-fab {
  width: 34px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--ds-ink); color: #fff;
}
body.ds-mobile .ds-mnav-item--primary { color: var(--ds-ink2); }


body.ds-mobile .ds-menu-backdrop { position: fixed; inset: 0; z-index: 60; background: transparent; }
body.ds-mobile .ds-menu {
  position: fixed; z-index: 61;
  top: calc(52px + env(safe-area-inset-top) + 4px); right: 8px;
  width: min(300px, calc(100vw - 16px));
  max-height: calc(100vh - 52px - env(safe-area-inset-top) - 16px); overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 6px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  transform-origin: top right;
  animation: ds-menu-in 120ms ease-out;
}
@keyframes ds-menu-in { from { transform: scale(.96); opacity: 0; } }
body.ds-mobile .ds-menu-group {
  padding: 10px 10px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ds-muted2);
}
body.ds-mobile .ds-menu-item {
  display: flex; align-items: center; width: 100%;
  min-height: 44px; padding: 0 10px;
  border: none; background: none; border-radius: 8px;
  font-family: inherit; font-size: 14.5px; color: var(--ds-ink2);
  text-decoration: none; cursor: pointer; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
body.ds-mobile .ds-menu-item:active { background: var(--ds-line2); }
body.ds-mobile .ds-menu-item.is-current { background: var(--ds-line2); color: var(--ds-ink); font-weight: 600; }
body.ds-mobile .ds-menu-item--danger { color: var(--ds-bad); }
body.ds-mobile .ds-menu-sep { height: 1px; margin: 6px 4px; background: var(--ds-line2); flex-shrink: 0; }
body.ds-mobile .ds-menu-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
body.ds-mobile .ds-menu-user .ds-avatar { width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }
body.ds-mobile .ds-menu-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
body.ds-mobile .ds-menu-user-name { font-size: 13.5px; font-weight: 600; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ds-mobile .ds-menu-user-note { font-size: 11.5px; color: var(--ds-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ds-mobile .ds-menu-version { font-family: 'Geist Mono', monospace; font-size: 10.5px; color: var(--ds-muted2); text-align: center; padding: 6px 0 2px; }




body.ds-mobile .ds-subheader { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
body.ds-mobile .ds-subheader-title { display: none; }
body.ds-mobile .ds-subheader-meta { margin-top: 0; }
body.ds-mobile .ds-content { padding: 12px; gap: 12px; }


body.ds-mobile input, body.ds-mobile select, body.ds-mobile textarea { font-size: 16px; }


body.ds-mobile .ds-btn { min-height: 40px; padding: 8px 14px; font-size: 13px; }
body.ds-mobile .ds-tab { min-height: 44px; font-size: 13px; }


body.ds-mobile .ds-table { font-size: 12px; }
body.ds-mobile .ds-table th, body.ds-mobile .ds-table td { padding: 8px; }
body.ds-mobile .ds-table-info { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
body.ds-mobile .ds-pagesize { margin-left: 0; }
body.ds-mobile .ds-pagesize-opt { padding: 6px 12px; font-size: 12px; }
body.ds-mobile .ds-loadmore-btn { width: 100%; justify-content: center; padding: 12px 16px; font-size: 13px; }


body.ds-mobile .ds-modal-backdrop { align-items: flex-end !important; padding: 0; }
body.ds-mobile .ds-modal {
  width: 100% !important; max-width: 100% !important;
  max-height: 92vh; border-radius: 14px 14px 0 0; border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom);
}
body.ds-mobile .ds-modal-header { padding: 14px 16px 12px; }
body.ds-mobile .ds-modal-body   { padding: 14px 16px; }
body.ds-mobile .ds-modal-footer { padding: 12px 16px; flex-wrap: wrap; }
body.ds-mobile .ds-modal-footer .ds-btn { flex: 1 1 auto; justify-content: center; }


body.ds-mobile .ds-owner-pop { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
body.ds-mobile .ds-filter-wide .ds-filter-pop { width: calc(100vw - 24px); }
body.ds-mobile .ds-filter-btn { max-width: none; height: 40px; }


body.ds-mobile .ds-rc { align-items: flex-end; padding: 12px; }
body.ds-mobile .ds-rc-card { max-width: 100%; flex-wrap: wrap; }
body.ds-mobile .ds-rc-actions { flex-direction: row; width: 100%; }
body.ds-mobile .ds-rc-actions .ds-btn { flex: 1 1 auto; justify-content: center; }
body.ds-mobile .ds-empty-cell { padding: 20px 12px; }


body.ds-mobile .ds-pcards { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 4px; }
body.ds-mobile .ds-pcard {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  grid-template-areas:
    "img  main check"
    "foot foot foot";
  gap: 0 10px;
  padding: 10px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line); border-radius: 10px;
}
body.ds-mobile .ds-pcard-main { grid-area: main; min-width: 0; }
body.ds-mobile .ds-pcard--selected { border-color: var(--ds-accent); background: var(--ds-bg); }

body.ds-mobile .ds-pcard--open, body.ds-mobile .ds-pcard:focus {
  outline: none; border-color: var(--ds-accent); box-shadow: 0 0 0 2px var(--ds-accent);
}
body.ds-mobile .ds-pcard--archived { opacity: .55; }
body.ds-mobile .ds-pcard--locked { opacity: .6; }
body.ds-mobile .ds-pcard--locked button,
body.ds-mobile .ds-pcard--locked a,
body.ds-mobile .ds-pcard--locked input { pointer-events: none !important; }

body.ds-mobile .ds-pcard-img { grid-area: img; position: relative; width: 52px; height: 52px; }
body.ds-mobile .ds-pcard-thumb {
  position: absolute; inset: 0; width: 52px; height: 52px; border-radius: 8px;
  object-fit: contain; background: var(--ds-bg); border: 1px solid var(--ds-line); display: block;
}
body.ds-mobile .ds-pcard-thumb-empty {
  width: 52px; height: 52px; border-radius: 8px; padding: 0;
  border: 1.5px dashed var(--ds-muted2); background: var(--ds-line2);
  color: var(--ds-muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
body.ds-mobile .ds-pcard-name {
  font-size: 13.5px; font-weight: 600; color: var(--ds-ink); line-height: 1.3;
  
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body.ds-mobile .ds-pcard-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; min-width: 0; }
body.ds-mobile .ds-pcard-id   { font-family: 'Geist Mono', monospace; font-size: 11.5px; color: var(--ds-muted); }
body.ds-mobile .ds-pcard-sub  { font-size: 11px; color: var(--ds-muted2); }

body.ds-mobile .ds-pcard-check {
  grid-area: check; align-self: start; justify-self: end;
  width: 40px; height: 40px; margin: -8px -8px 0 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
}
body.ds-mobile .ds-pcard-check input { width: 20px; height: 20px; margin: 0; }
body.ds-mobile .ds-pcard-check:disabled { opacity: .3; cursor: not-allowed; }


body.ds-mobile .ds-listbox { background: transparent !important; border: none !important; border-radius: 0 !important; }

body.ds-mobile .ds-pcard-foot {
  grid-area: foot; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ds-line2);
}
body.ds-mobile .ds-pcard-status { font-size: 11.5px; font-weight: 600; white-space: nowrap; }

body.ds-mobile .ds-pcard-num {
  display: inline-flex; align-items: baseline; gap: 4px;
  min-height: 34px; padding: 4px 10px;
  border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-bg);
  font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--ds-ink2); cursor: pointer;
}
body.ds-mobile .ds-pcard-num-label { font-family: 'Geist', sans-serif; font-size: 10px; color: var(--ds-muted); text-transform: uppercase; letter-spacing: .5px; }
body.ds-mobile .ds-pcard-num input {
  width: 5.5em; border: none; outline: none; background: none; padding: 0;
  font-family: 'Geist Mono', monospace; font-size: 16px; text-align: right; color: var(--ds-ink);
}
body.ds-mobile .ds-pcard-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
body.ds-mobile .ds-pcard-act {
  width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 8px; color: var(--ds-muted); cursor: pointer;
}
body.ds-mobile .ds-pcard-act--ok  { color: var(--ds-ok); }
body.ds-mobile .ds-pcard-act--bad { color: var(--ds-bad); }
body.ds-mobile .ds-pcard-act:disabled { opacity: .32; cursor: not-allowed; }


body.ds-mobile .ds-mtools {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--ds-surface); border-bottom: 1px solid var(--ds-line);
}
body.ds-mobile .ds-mtools .ds-search { margin: 0; max-width: none; flex: 1; }
body.ds-mobile .ds-mtools-btn {
  position: relative; flex-shrink: 0; width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ds-line); border-radius: 8px;
  background: var(--ds-bg); color: var(--ds-ink2); cursor: pointer;
}
body.ds-mobile .ds-mtools-btn.is-active { border-color: var(--ds-accent); }

body.ds-mobile .ds-mtools-dot {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--ds-accent); border: 1.5px solid var(--ds-surface);
}
body.ds-mobile .ds-mstats {
  flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 12px; background: var(--ds-bg); border-bottom: 1px solid var(--ds-line); font-size: 11.5px;
}


body.ds-mobile .ds-mselbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 8px 10px;
  background: var(--ds-ink); color: #fff; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
body.ds-mobile .ds-mselbar-count { font-size: 12.5px; font-weight: 600; }
body.ds-mobile .ds-mselbar .ds-btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
body.ds-mobile .ds-mselbar .ds-btn:disabled { opacity: .4; }
body.ds-mobile .ds-mselbar-clear { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.75); font-family: inherit; font-size: 12px; cursor: pointer; padding: 8px; }


body.ds-mobile .ds-fsheet-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; border-bottom: 1px solid var(--ds-line2); }
body.ds-mobile .ds-fsheet-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--ds-ink); }
body.ds-mobile .ds-fsheet-clear { min-height: 36px; padding: 0 8px; border: none; background: none; border-radius: 6px; font-family: inherit; font-size: 12.5px; color: var(--ds-muted); cursor: pointer; }
body.ds-mobile .ds-fsheet-group { padding: 10px 4px 4px; }

body.ds-mobile .ds-fsheet-group .ds-chip { min-height: 38px; padding: 6px 12px; font-size: 13px; }
body.ds-mobile .ds-fsheet-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }


body.ds-mobile .ds-mdetail-shell    { padding: 0 !important; }
body.ds-mobile .ds-mdetail-backdrop { display: none !important; }
body.ds-mobile .ds-mdetail-panel    { width: 100% !important; border-left: none !important; box-shadow: none !important; }

body.ds-mobile .ds-mdetail-tabs { overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; }
body.ds-mobile .ds-mdetail-tabs::-webkit-scrollbar { display: none; }
body.ds-mobile .ds-mdetail-tabs > button { flex: 0 0 auto !important; padding: 12px 13px !important; font-size: 12.5px !important; }


body.ds-mobile .ds-mnotice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px; border: 1px dashed var(--ds-line); border-radius: 8px;
  background: var(--ds-bg); color: var(--ds-muted); font-size: 12.5px; line-height: 1.5;
}
body.ds-mobile .ds-mnotice svg { flex-shrink: 0; margin-top: 1px; }


body.ds-mobile .ds-scan {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column;
  background: #0a0a0a; color: #fff;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
body.ds-mobile .ds-scan-head  { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; }
body.ds-mobile .ds-scan-title { flex: 1; font-size: 15px; font-weight: 600; }
body.ds-mobile .ds-scan-close { width: 44px; height: 44px; flex-shrink: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: none; background: none; color: #fff; cursor: pointer; border-radius: 50%; }
body.ds-mobile .ds-scan-stage { flex: 1 1 auto; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }
body.ds-mobile .ds-scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }

body.ds-mobile .ds-scan-stage:has(.ds-scan-message) .ds-scan-video { display: none; }

body.ds-mobile .ds-scan-frame {
  position: absolute; left: 8%; right: 8%; top: 50%; transform: translateY(-50%);
  height: 34%; border: 2px solid rgba(255,255,255,.85); border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none;
}
body.ds-mobile .ds-scan-hint { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.8); padding: 0 24px; pointer-events: none; }
body.ds-mobile .ds-scan-message { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 320px; padding: 24px; text-align: center; font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.82); }
body.ds-mobile .ds-scan-message .ds-spinner { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
body.ds-mobile .ds-scan-manual { flex: 0 0 auto; display: flex; gap: 8px; padding: 12px 16px; }
body.ds-mobile .ds-scan-input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; font-family: 'Geist Mono', monospace; letter-spacing: .5px; outline: none;
}
body.ds-mobile .ds-scan-input::placeholder { color: rgba(255,255,255,.45); }

body.ds-mobile .ds-scan-problem { flex: 0 0 auto; margin: 0 16px 10px; padding: 10px 12px; border-radius: 8px; background: rgba(220,38,38,.16); border: 1px solid rgba(248,113,113,.5); color: #fecaca; font-size: 12.5px; line-height: 1.45; }
body.ds-mobile .ds-scan-log { flex: 0 0 auto; max-height: 27vh; overflow-y: auto; margin: 0 16px 14px; padding: 10px 12px; border-radius: 8px; background: rgba(255,255,255,.06); }
body.ds-mobile .ds-scan-log-head { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: rgba(255,255,255,.55); margin-bottom: 6px; }
body.ds-mobile .ds-scan-log-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-family: 'Geist Mono', monospace; font-size: 12.5px; color: rgba(255,255,255,.9); }
body.ds-mobile .ds-scan-open { width: 100%; justify-content: center; min-height: 46px; margin-bottom: 10px; flex-shrink: 0; }


body.ds-mobile .ds-mtiles { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
body.ds-mobile .ds-mtiles > div { padding: 14px !important; }
body.ds-mobile .ds-input-panel { padding: 12px; }
body.ds-mobile .ds-textarea { font-size: 16px; line-height: 1.5; }
