/* Mobile shell — ADMIN / OWNER / MANAGE USER (see mshell/admin.js).
   Stat tiles + row cards; legacy rows filled by app.js loaders
   (.owner-approval-row, .owner-user-row, .owner-rec-row, .hs-trow)
   are restyled here, scoped to .mwad-page. Prefix: mwad-. */
@media (max-width: 979px) {
  html.web-shell .mwad-page { gap: 12px; }
  html.web-shell .mwad-intro { font-size: 12px; color: var(--mws-ink-3); margin: 0 2px -2px; }
  html.web-shell .mwad-shead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  html.web-shell .mwad-cap { font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); letter-spacing: 0.06em; }
  html.web-shell .mwad-count { color: var(--mws-gold); margin-left: 4px; }
  html.web-shell .mwad-note { font-size: 12px; line-height: 1.5; color: var(--mws-ink-3); }
  html.web-shell .mwad-hints { font-size: 11px; line-height: 1.5; color: var(--mws-ink-3); display: flex; flex-direction: column; gap: 3px; }

  /* stat tiles: 2-up grid, odd last tile spans the row */
  html.web-shell .mwad-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html.web-shell .mwad-tile {
    background: var(--mws-well); border: 1px solid var(--mws-line); border-radius: 12px;
    padding: 11px 12px; min-width: 0;
    display: flex; flex-direction: column; gap: 5px;
  }
  html.web-shell .mwad-tiles > .mwad-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  html.web-shell .mwad-tile .mws-lbl { font-size: 9px; letter-spacing: 0.1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwad-tile .v {
    font-family: var(--mws-mono); font-size: 18px; font-weight: 600; color: var(--mws-ink);
    letter-spacing: -0.01em; overflow-wrap: anywhere;
  }
  html.web-shell .mwad-tile .hint {
    font-family: var(--mws-mono); font-size: 9.5px; line-height: 1.4; color: var(--mws-ink-3);
    overflow-wrap: anywhere;
  }

  /* owner-tools row */
  html.web-shell .mwad-owner .sub { white-space: normal; }
  html.web-shell .mwad-chev { margin-left: auto; font-size: 20px; color: var(--mws-ink-3); flex-shrink: 0; }

  /* ---------------------------------------------- support tickets */
  html.web-shell .mwad-support { display: flex; flex-direction: column; gap: 10px; }
  html.web-shell .mwad-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  html.web-shell .mwad-chips::-webkit-scrollbar { display: none; }
  html.web-shell .mwad-chips .mws-chip { flex-shrink: 0; min-height: 34px; }
  html.web-shell .mwad-tkts { display: flex; flex-direction: column; gap: 8px; }
  html.web-shell .mwad-tkts .empty {
    padding: 24px 16px; text-align: center; color: var(--mws-ink-3); font-size: 13px;
    border: 1px dashed var(--mws-line); border-radius: 16px;
  }
  html.web-shell .mwad-tkts .hs-trow {
    display: flex; align-items: center; gap: 12px; min-width: 0;
    background: var(--mws-card); border: 1px solid var(--mws-line); border-radius: 16px;
    padding: 13px 14px; cursor: pointer; min-height: 44px;
  }
  html.web-shell .mwad-tkts .hs-trow:last-child { border-bottom: 1px solid var(--mws-line); }
  html.web-shell .mwad-tkts .hs-tid {
    font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-gold); flex-shrink: 0;
    background: rgba(240, 185, 11, 0.1); border-radius: 8px; padding: 4px 7px;
  }
  html.web-shell .mwad-tkts .hs-tl { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  html.web-shell .mwad-tkts .hs-tl b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.web-shell .mwad-tkts .hs-tl span {
    font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html.web-shell .mwad-tkts .hs-badge {
    flex-shrink: 0; font-family: var(--mws-mono); font-size: 9.5px; font-weight: 700;
    padding: 3px 7px; border-radius: 6px; letter-spacing: 0.04em;
    color: var(--mws-up); background: rgba(32, 199, 117, 0.12);
  }
  html.web-shell .mwad-tkts .hs-badge.wait { color: var(--mws-gold); background: rgba(240, 185, 11, 0.12); }
  html.web-shell .mwad-tkts .hs-badge.closed { color: var(--mws-ink-3); background: var(--mws-well); }

  /* ------------------------------------------------ owner list cards */
  html.web-shell .mwad-listcard { gap: 10px; }
  html.web-shell .mwad-rows { display: flex; flex-direction: column; gap: 8px; }
  html.web-shell .mwad-rows > .muted { font-size: 12.5px !important; color: var(--mws-ink-3); padding: 6px 0 !important; }
  html.web-shell .mwad-searchwrap {
    display: flex; align-items: center; gap: 8px; height: 42px; box-sizing: border-box;
    padding: 0 12px; border-radius: 12px; color: var(--mws-ink-3);
    background: var(--mws-bg); border: 1px solid var(--mws-line);
  }
  html.web-shell .mwad-searchwrap:focus-within { border-color: rgba(240, 185, 11, 0.5); }
  html.web-shell .mwad-searchwrap .icon { display: inline-flex; flex-shrink: 0; }
  html.web-shell .mwad-search {
    flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0;
    color: var(--mws-ink); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
  }
  html.web-shell .mwad-search::placeholder { color: var(--mws-ink-3); font-size: 13px; }

  /* approvals */
  html.web-shell .mwad-page .owner-approval-row {
    display: flex; flex-direction: column; gap: 10px; align-items: stretch;
    background: var(--mws-well); border: 1px solid var(--mws-line); border-radius: 14px;
    padding: 12px; margin: 0;
  }
  html.web-shell .mwad-page .owner-approval-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  html.web-shell .mwad-page .owner-approval-name { font-size: 14.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwad-page .owner-approval-sub { font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); overflow-wrap: anywhere; }
  html.web-shell .mwad-page .owner-approval-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  html.web-shell .mwad-page .owner-approval-actions .btn,
  html.web-shell .mwad-page .owner-rec-actions .btn {
    height: 42px !important; min-height: 42px; width: 100%; margin: 0;
    border-radius: 999px !important; padding: 0 14px !important;
    font-size: 13.5px !important; font-weight: 800;
  }
  html.web-shell .mwad-page .owner-approval-actions .btn:not(.ghost) {
    background: linear-gradient(180deg, #fcd535 0%, #f0b90b 100%); color: #1a1206; border: 0;
  }
  html.web-shell .mwad-page .owner-approval-actions .btn.ghost,
  html.web-shell .mwad-page .owner-rec-actions .btn.ghost {
    background: transparent; color: var(--mws-down); border: 1px solid rgba(234, 57, 67, 0.4);
  }

  /* users */
  html.web-shell .mwad-page .owner-user-row {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    background: var(--mws-well); border: 1px solid var(--mws-line); border-radius: 14px;
    padding: 12px; margin: 0; cursor: pointer; grid-template-columns: none;
  }
  html.web-shell .mwad-page .owner-user-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  html.web-shell .mwad-page .owner-user-name { font-size: 14.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwad-page .owner-user-id-line {
    font-family: var(--mws-mono); font-size: 10px; color: var(--mws-ink-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html.web-shell .mwad-page .owner-user-tags,
  html.web-shell .mwad-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
  html.web-shell .mwad-page .owner-pill-inline,
  html.web-shell .mwad-page .admin-pill-inline,
  html.web-shell .mwad-page .owner-user-tags .tag,
  html.web-shell .mwad-page .owner-user-tags .level-pill,
  html.web-shell .mwad-tags .level-pill {
    font-family: var(--mws-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
    padding: 2px 7px; border-radius: 6px; border: 0; line-height: 1.5;
    display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  }
  html.web-shell .mwad-page .owner-pill-inline { color: var(--mws-gold); background: rgba(240, 185, 11, 0.12); }
  html.web-shell .mwad-page .admin-pill-inline { color: var(--mws-gold); background: transparent; box-shadow: inset 0 0 0 1px rgba(240, 185, 11, 0.4); }
  html.web-shell .mwad-page .owner-user-tags .tag.ok { color: var(--mws-up); background: rgba(32, 199, 117, 0.12); }
  html.web-shell .mwad-page .owner-user-tags .tag.warn { color: var(--mws-ink-3); background: var(--mws-bg); }
  html.web-shell .mwad-page .owner-user-tags .level-pill,
  html.web-shell .mwad-tags .level-pill { color: var(--mws-demo); background: rgba(139, 123, 255, 0.14); }
  html.web-shell .mwad-page .owner-user-actions { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
  html.web-shell .mwad-page .owner-user-manage {
    font-family: var(--mws-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mws-gold);
  }
  html.web-shell .mwad-page .owner-user-chev { font-size: 20px; color: var(--mws-ink-3); line-height: 1; }

  /* recommendations */
  html.web-shell .mwad-page .owner-rec-row {
    display: flex; flex-direction: column; gap: 5px;
    background: var(--mws-well); border: 1px solid var(--mws-line); border-radius: 14px;
    padding: 12px; margin: 0;
  }
  html.web-shell .mwad-page .owner-rec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  html.web-shell .mwad-page .owner-rec-pair { font-weight: 800; font-size: 14.5px; }
  html.web-shell .mwad-page .owner-rec-expiry {
    font-family: var(--mws-mono); font-size: 10px; color: var(--mws-up);
    background: rgba(32, 199, 117, 0.12); padding: 2px 7px; border-radius: 6px;
  }
  html.web-shell .mwad-page .owner-rec-expiry.urgent { color: var(--mws-gold); background: rgba(240, 185, 11, 0.12); }
  html.web-shell .mwad-page .owner-rec-metrics { font-family: var(--mws-mono); font-size: 11px; color: var(--mws-ink-2); overflow-wrap: anywhere; }
  html.web-shell .mwad-page .owner-rec-period { font-family: var(--mws-mono); font-size: 10px !important; color: var(--mws-ink-3); }
  html.web-shell .mwad-page .owner-rec-note { font-size: 12px; color: var(--mws-ink-3); font-style: italic; overflow-wrap: anywhere; }
  html.web-shell .mwad-page .owner-rec-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
  html.web-shell .mwad-page .owner-rec-actions .btn { width: auto; min-width: 110px; }

  /* error log: wraps inside the card (never wider than the screen) */
  html.web-shell .mwad-log {
    margin: 0; max-height: 320px; overflow: auto;
    background: var(--mws-bg); border: 1px solid var(--mws-line); border-radius: 12px;
    padding: 10px 12px; font-family: var(--mws-mono); font-size: 10.5px; line-height: 1.55;
    color: #ff8a92; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  }

  /* ------------------------------------------------- manage user */
  html.web-shell .mwad-uhero { background: linear-gradient(180deg, var(--mws-hero-a), var(--mws-hero-b)); }
  html.web-shell .mwad-uid { display: flex; align-items: center; gap: 12px; min-width: 0; }
  html.web-shell .mwad-avatar {
    width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fcd535, #f0b90b); color: #1a1206;
    font-weight: 800; font-size: 15px;
  }
  html.web-shell .mwad-uid .meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  html.web-shell .mwad-uid .nm { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.web-shell .mwad-uid .sub { font-family: var(--mws-mono); font-size: 11px; color: var(--mws-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.web-shell .mwad-idline {
    font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3);
    background: var(--mws-well); border: 1px solid var(--mws-line); border-radius: 10px;
    padding: 7px 10px; overflow-wrap: anywhere;
  }
  html.web-shell .mwad-viewas { margin-top: 2px; }
  html.web-shell .mwad-eye { display: inline-flex; }
  html.web-shell .mwad-perm .mws-kv { min-height: 44px; }
  html.web-shell .mwad-perm .mws-kv .v { font-family: var(--font); display: inline-flex; justify-content: flex-end; min-width: 0; }
  html.web-shell .mwad-perm .mws-kv .v .muted { font-size: 12px !important; color: var(--mws-ink-3); text-align: right; }
  html.web-shell .mwad-select {
    height: 40px; min-width: 130px; max-width: 180px; box-sizing: border-box;
    border-radius: 999px; padding: 0 30px 0 14px;
    background: var(--mws-bg); border: 1px solid var(--mws-line); color: var(--mws-ink);
    font-family: var(--mws-mono); font-size: 13px; font-weight: 600;
  }
  html.web-shell .mws-btn.mwad-rolebtn { height: 40px; padding: 0 18px; font-size: 13px; }
  html.web-shell .mwad-bot { gap: 12px; }
  html.web-shell .mwad-bhead { display: flex; align-items: center; gap: 12px; min-width: 0; }
  html.web-shell .mwad-bhead .meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  html.web-shell .mwad-bhead .nm { font-weight: 800; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  html.web-shell .mwad-bhead .sub { font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.web-shell .mwad-bhead .right { margin-left: auto; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
  html.web-shell .mwad-bhead .right .v { font-family: var(--mws-mono); font-size: 14px; font-weight: 600; }
  html.web-shell .mwad-bhead .right .cap { font-family: var(--mws-mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--mws-ink-3); }
  html.web-shell .mwad-bot .mws-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 12px; border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwad-bot .mws-stat .v { font-size: 13px; }
  html.web-shell .mwad-bot .mws-stat .mws-lbl { font-size: 8.5px; letter-spacing: 0.08em; }
  html.web-shell .mwad-of { display: block; font-size: 10px; font-weight: 500; color: var(--mws-ink-3); margin-top: 2px; }
}
