@media (max-width: 760px) {
  html.stocktracker-android,
  html.stocktracker-android body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: #f5f8fc;
    -webkit-text-size-adjust: 100%;
  }

  html.stocktracker-android .app.ready {
    display: block;
    min-height: 100dvh;
    width: 100%;
  }

  html.stocktracker-android .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: calc(7px + env(safe-area-inset-top)) 8px 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg,#052d70,#063482 60%,#0752c7);
    box-shadow: 0 5px 16px rgba(6,52,130,.14);
  }

  html.stocktracker-android .sidebar::-webkit-scrollbar { display: none; }

  html.stocktracker-android .brand {
    flex: 0 0 auto;
    width: 116px;
    min-width: 116px;
    padding: 5px 7px;
    margin: 0;
    border-radius: 11px;
    box-shadow: none;
  }

  html.stocktracker-android .brand img {
    display: block;
    width: 102px;
    max-width: 100%;
    height: auto;
  }

  html.stocktracker-android .nav {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    width: auto;
  }

  html.stocktracker-android .nav button {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 9px;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    font-size: 10.5px;
    font-weight: 650;
  }

  html.stocktracker-android .sideFoot { display: none; }

  html.stocktracker-android .main {
    width: 100%;
    max-width: 100%;
    padding: 13px 10px calc(18px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  html.stocktracker-android .top { margin-bottom: 9px; }
  html.stocktracker-android .top h1 { font-size: clamp(21px,6vw,25px); line-height: 1.12; }
  html.stocktracker-android .top p { margin-top: 3px; font-size: 12.5px; line-height: 1.4; }
  html.stocktracker-android .statusLine { margin-bottom: 10px; font-size: 11px; }

  html.stocktracker-android .grid4 {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }

  html.stocktracker-android .card {
    min-width: 0;
    padding: 12px;
    border-radius: 13px;
  }

  html.stocktracker-android .cols {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 9px;
  }

  html.stocktracker-android .searchbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  html.stocktracker-android .searchbar input,
  html.stocktracker-android .searchbar select {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }

  html.stocktracker-android .searchbar .btn {
    flex: 1 1 140px;
    min-height: 42px;
  }

  html.stocktracker-android .tableWrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 13px;
    -webkit-overflow-scrolling: touch;
  }

  html.stocktracker-android table { min-width: 620px; font-size: 11.5px; }
  html.stocktracker-android th,
  html.stocktracker-android td { padding: 9px 10px; }

  html.stocktracker-android input,
  html.stocktracker-android select,
  html.stocktracker-android textarea {
    max-width: 100%;
    font-size: 16px;
  }

  html.stocktracker-android .btn,
  html.stocktracker-android button {
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  html.stocktracker-android .modalBackdrop { align-items: flex-end; padding: 8px; }
  html.stocktracker-android .modal {
    width: min(680px,100%);
    max-height: 90dvh;
    border-radius: 18px;
    overflow: auto;
  }

  html.stocktracker-android .authGate,
  html.stocktracker-android .accessGate {
    padding: calc(16px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  }

  html.stocktracker-android .authCard,
  html.stocktracker-android .accessGateCard {
    width: 100%;
    max-width: 420px;
    padding: 20px 16px;
  }

  html.stocktracker-android .toast {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: none;
  }

  html.stocktracker-android .stScanGrid { grid-template-columns: 1fr; gap: 9px; }
  html.stocktracker-android .stScanStage { min-height: 220px; }
}

@media (max-width: 390px) {
  html.stocktracker-android .brand { width: 108px; min-width: 108px; }
  html.stocktracker-android .brand img { width: 94px; }
  html.stocktracker-android .nav button { min-height: 36px; padding-inline: 8px; font-size: 10px; }
  html.stocktracker-android .main { padding-inline: 9px; }
  html.stocktracker-android .grid4 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  html.stocktracker-android .card { padding: 10px; }
}

@media (max-width: 340px) {
  html.stocktracker-android .grid4 { grid-template-columns: 1fr; }
}
