@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    min-width: 320px;
    margin: 0;
    padding: 0;
    overflow-x: clip;
  }

  #root {
    width: 100%;
    min-height: 100dvh;
    overflow-x: clip;
    background: #f4f6fb;
    color: #1e293b;
    box-sizing: border-box;
  }

  #root:has(.fnl-card-inner) {
    background: #f4f6fb !important;
  }

  #root:has(.fnl-card-inner) > div:nth-child(2) {
    background: #f4f6fb !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: min(100%, 430px) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 auto !important;
    padding-bottom: 62px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: none !important;
    background: #f4f6fb !important;
    color: #1e293b !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img,
  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div {
    display: none !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div {
    top: 16px !important;
    width: 72px !important;
    height: 72px !important;
    border-color: #fff !important;
    box-shadow: 0 0 0 2px #4f46e5, 0 8px 24px rgba(15, 23, 42, .16) !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div + div {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: min(92%, 400px) !important;
    max-height: none !important;
    margin: 72px auto 16px !important;
    overflow: visible !important;
    transform: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08) !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div + div > div:first-child {
    padding-top: 48px !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div + div > div:last-child {
    overflow: visible !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div + div button[style*="width: 100%"] {
    min-height: 44px;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .2) !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div + div + div {
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 62px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #fff !important;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .04) !important;
  }

  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div + div + div,
  #root > div[style*="max-width: 430px"]:has(.fnl-card-inner) > img + div + div + div + div * {
    color: #475569 !important;
  }

  #root *,
  #root *::before,
  #root *::after {
    box-sizing: border-box;
  }

  #root * {
    min-width: 0;
  }

  #root > *,
  #root main,
  #root section,
  #root article,
  #root form {
    min-width: 0;
    max-width: 100%;
  }

  #root img,
  #root svg,
  #root video,
  #root canvas {
    max-width: 100%;
  }

  #root button,
  #root [role="button"],
  #root input,
  #root select,
  #root textarea {
    max-width: 100%;
  }

  #root button,
  #root [role="button"] {
    min-height: 40px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #root input,
  #root select,
  #root textarea {
    min-width: 0;
    font-size: 16px;
  }

  #root table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  #root [role="tablist"],
  #root .tabs,
  #root .tab-list {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  #root [role="dialog"],
  [role="dialog"] {
    width: min(100% - 24px, 560px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    overscroll-behavior: contain;
  }

  body > div:first-child {
    min-height: 100dvh !important;
    padding: 16px 14px calc(24px + env(safe-area-inset-bottom)) !important;
    background: #f4f6fb !important;
    color: #1e293b !important;
    box-sizing: border-box;
  }

  body > div:first-child > div:first-child {
    width: 100% !important;
    max-width: 500px !important;
    margin-bottom: 16px !important;
  }

  .card,
  .app-card {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: none;
  }

  .btn {
    min-height: 40px;
  }

  .app-card {
    padding: 14px;
    border-radius: 14px;
  }

  #loginSection h3,
  #appsSection h2,
  .modal h3,
  body > div:first-child h1 {
    color: #1e293b !important;
  }

  .app-card > div:first-child > span:first-child {
    color: #1e293b !important;
    overflow-wrap: anywhere;
  }

  .input {
    min-height: 44px;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
  }

  .input::placeholder {
    color: #94a3b8 !important;
  }

  .action-btns {
    gap: 8px;
  }

  .action-btns .btn {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
    min-height: 40px;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
    text-align: center;
  }

  #appsSection > div:first-child {
    align-items: flex-start !important;
    flex-wrap: wrap;
    gap: 10px;
  }

  #appsSection > div:first-child > div {
    flex-wrap: wrap;
  }

  .overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .modal {
    width: 100%;
    max-width: 400px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 18px;
    background: #fff !important;
    border-color: #e2e8f0 !important;
    color: #1e293b;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    -webkit-overflow-scrolling: touch;
  }

  .modal p {
    overflow-wrap: anywhere;
    color: #64748b !important;
  }

  #editLicenseCurrent {
    color: #1e293b !important;
  }

  #editLicenseCurrent[style*="rgb(34, 197, 94)"] {
    color: #16a34a !important;
  }

  #editLicenseCurrent[style*="rgb(239, 68, 68)"] {
    color: #dc2626 !important;
  }

  .modal .btn {
    min-height: 44px;
    min-width: 0;
    padding-inline: 10px;
    white-space: normal;
  }

  .toast {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    width: auto;
    text-align: center;
  }
}
