/* Mobile shell — ADD COIN (see mshell/addtoken.js). */
@media (max-width: 979px) {
  html.web-shell .mwa { gap: 13px; }
  html.web-shell .mwa-ht { overflow: hidden; text-overflow: ellipsis; }

  /* header Real / Demo segmented pill (Portfolio board) */
  html.web-shell .mwa-seg {
    display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
    border: 1px solid var(--mws-line); background: var(--mws-card);
  }
  html.web-shell .mwa-seg button {
    height: 30px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
    background: transparent; font-family: var(--mws-mono); font-size: 11.5px; white-space: nowrap;
    color: var(--mws-ink-3);
  }
  html.web-shell .mwa-seg button.demo { color: var(--mws-demo); }
  html.web-shell .mwa-seg button.real.on { background: rgba(240, 185, 11, 0.14); color: var(--mws-gold); font-weight: 600; }
  html.web-shell .mwa-seg button.demo.on { background: rgba(139, 123, 255, 0.16); color: var(--mws-demo); font-weight: 600; }

  /* bot limit */
  html.web-shell .mwa-limit { gap: 10px; padding: 14px 16px; }
  html.web-shell .mwa-limrow { display: flex; align-items: center; justify-content: space-between; }
  html.web-shell .mwa-limrow .v { font-family: var(--mws-mono); font-size: 13px; font-weight: 600; }
  html.web-shell .mwa-bar { height: 6px; border-radius: 999px; background: var(--mws-well); overflow: hidden; }
  html.web-shell .mwa-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f0b90b, #fcd535); }
  html.web-shell .mwa-limit.at .mwa-bar span { background: var(--mws-down); }
  html.web-shell .mwa-limit.at .mwa-limrow .v { color: var(--mws-down); }
  html.web-shell .mwa-limhint { font-size: 12px; color: var(--mws-down); }

  /* search */
  html.web-shell .mwa-search {
    display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
    background: var(--mws-card); border: 1px solid var(--mws-line); border-radius: 14px;
    color: var(--mws-ink-3);
  }
  html.web-shell .mwa-search:focus-within { border-color: rgba(240, 185, 11, 0.5); }
  html.web-shell .mwa-search input {
    flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; padding: 0;
    background: transparent; border: 0; box-shadow: none; outline: none;
    font-family: var(--font); font-size: 15px; color: var(--mws-ink);
  }
  html.web-shell .mwa-search input::placeholder { color: var(--mws-ink-3); }

  /* categories */
  html.web-shell .mwa-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  html.web-shell .mwa-cats::-webkit-scrollbar { display: none; }
  html.web-shell .mwa-cats .mws-chip {
    flex-shrink: 0; min-height: 36px; display: inline-flex; align-items: center; gap: 6px;
  }
  html.web-shell .mwa-cats .mws-chip .sub { font-size: 9.5px; opacity: 0.7; }
  html.web-shell .mwa .mws-sec { margin-top: 2px; }

  /* coin rows */
  html.web-shell .mwa-list { display: flex; flex-direction: column; gap: 10px; }
  html.web-shell .mwa-row {
    display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer;
    background: var(--mws-card); border: 1px solid var(--mws-line); border-radius: 16px; padding: 14px;
  }
  html.web-shell .mwa.emul .mwa-row { border-color: rgba(139, 123, 255, 0.25); }
  html.web-shell .mwa-row:active { background: var(--mws-well); }
  html.web-shell .mwa-row .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
  html.web-shell .mwa-row .nm { font-weight: 800; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwa-row .sym { font-family: var(--mws-mono); font-size: 11px; color: var(--mws-ink-3); }
  html.web-shell .mwa-right { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
  html.web-shell .mwa-right .px { font-family: var(--mws-mono); font-size: 13.5px; font-weight: 600; }
  html.web-shell .mwa-right .chev { display: inline-flex; color: var(--mws-ink-3); }

  /* step 2: selected coin */
  html.web-shell .mwa-selcard { flex-direction: row; align-items: center; gap: 12px; }
  html.web-shell .mwa-selhead { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
  html.web-shell .mwa-selhead .atw-selmain { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
  html.web-shell .mwa-selhead .mws-badge { flex-shrink: 0; }
  html.web-shell .mwa-selhead .nm { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwa-selhead .sub { font-family: var(--mws-mono); font-size: 11.5px; color: var(--mws-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.web-shell .mwa-selhead .sub [data-live-price] { color: var(--mws-ink); font-weight: 600; }
  html.web-shell .mwa-change { flex-shrink: 0; padding: 10px 0 10px 6px; }

  /* cards + rows (Settings board language) */
  html.web-shell .mwa-card { padding: 4px 16px; gap: 0; }
  html.web-shell .mwa-cl { padding: 13px 0 4px; }
  html.web-shell .mwa-rows { display: flex; flex-direction: column; }
  html.web-shell .mwa-rows > * + *,
  html.web-shell .mwa-flat > * + * { border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwa-flat { display: flex; flex-direction: column; }
  html.web-shell .mwa-field { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; }
  html.web-shell .mwa-field .lab { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  html.web-shell .mwa-field .lab .t { font-size: 14px; color: var(--mws-ink-2); }
  html.web-shell .mwa-field .lab .hint { font-size: 11px; color: var(--mws-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwa-well {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    height: 38px; box-sizing: border-box; padding: 0 12px; max-width: 55%;
    background: var(--mws-well); border: 1px solid var(--mws-line-strong); border-radius: 9px;
    font-family: var(--mws-mono); font-size: 14px; font-weight: 600;
  }
  html.web-shell .mwa-well:focus-within { border-color: rgba(240, 185, 11, 0.55); }
  html.web-shell .mwa-well input {
    width: 5ch; max-width: 12ch; min-width: 0; height: auto; margin: 0; padding: 0;
    background: transparent; border: 0; border-radius: 0; box-shadow: none; outline: none;
    font-family: var(--mws-mono); font-size: 14px; font-weight: 600; color: var(--mws-ink); text-align: right;
  }
  html.web-shell .mwa-well .unit { color: var(--mws-ink-3); font-size: 11px; }

  /* optional-feature groups */
  html.web-shell .mwa-grp { display: flex; flex-direction: column; }
  html.web-shell .mwa-grp .atw-grphead {
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; cursor: pointer;
  }
  html.web-shell .mwa-grp .atw-gi {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(240, 185, 11, 0.12); color: var(--mws-gold);
  }
  html.web-shell .mwa-grp .atw-gc { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  html.web-shell .mwa-grp .gt { font-size: 14px; font-weight: 800; }
  html.web-shell .mwa-grp .gs { font-size: 11px; color: var(--mws-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwa-grp .atw-cnt {
    flex-shrink: 0; font-family: var(--mws-mono); font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 6px; color: var(--mws-up); background: rgba(32, 199, 117, 0.12);
  }
  html.web-shell .mwa-grp .atw-cnt.zero { color: var(--mws-ink-3); background: var(--mws-well); }
  html.web-shell .mwa-grp .atw-chev { display: inline-flex; color: var(--mws-ink-3); transition: transform .15s; }
  html.web-shell .mwa-grp.open .atw-chev { transform: rotate(90deg); }
  html.web-shell .mwa-grp .atw-grpbody {
    display: flex; flex-direction: column; margin: 0 0 12px; padding: 2px 12px;
    background: var(--mws-bg); border: 1px solid var(--mws-line-2); border-radius: 12px;
  }
  html.web-shell .mwa-grp .atw-grpbody > * + * { border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwa-grp .mwa-field { min-height: 48px; }
  html.web-shell .mwa-grp .mwa-field .lab .t { font-size: 13px; }
  html.web-shell .mwa-tog { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; cursor: pointer; }
  html.web-shell .mwa-tog .txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  html.web-shell .mwa-tog .txt .t { font-size: 13.5px; font-weight: 700; }
  html.web-shell .mwa-tog .txt .s { font-size: 11px; color: var(--mws-ink-3); line-height: 1.35; }
  html.web-shell .mwa-sw {
    flex-shrink: 0; position: relative; width: 36px; height: 20px; padding: 0; margin: 0; cursor: pointer;
    border-radius: 999px; background: var(--mws-well); border: 1px solid var(--mws-line);
  }
  html.web-shell .mwa-sw::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--mws-ink-3); transition: transform .15s;
  }
  html.web-shell .mwa-sw.on { background: rgba(32, 199, 117, 0.25); border-color: rgba(32, 199, 117, 0.45); }
  html.web-shell .mwa-sw.on::after { transform: translateX(16px); background: var(--mws-up); }

  /* estimate */
  html.web-shell .mwa-est { display: flex; flex-direction: column; padding-bottom: 8px; }
  html.web-shell .mwa-est .r {
    display: flex; justify-content: space-between; align-items: center; min-height: 40px;
    font-size: 13px; color: var(--mws-ink-2);
  }
  html.web-shell .mwa-est .r + .r { border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwa-est .v { font-family: var(--mws-mono); font-weight: 600; color: var(--mws-ink); }
  html.web-shell .mwa-est .v.up { color: var(--mws-up); }

  /* actions */
  html.web-shell .mwa-actions {
    display: flex; flex-direction: column; gap: 10px;
    position: sticky; z-index: 5; bottom: calc(var(--nav-h, 56px) + env(safe-area-inset-bottom, 0px) + 10px);
  }
  html.web-shell .mwa .mwa-deploy { height: 50px; font-size: 14.5px; }
  html.web-shell .mwa.emul .mwa-deploy {
    background: linear-gradient(180deg, #a497ff 0%, #8b7bff 100%); color: #0d0a24;
    box-shadow: 0 8px 30px -8px rgba(139, 123, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  html.web-shell .mwa .mwa-quick { background: var(--mws-bg); }
  html.web-shell .mwa-note { font-size: 11px; }
}
