/* iOS standalone / Safari safe areas, no changes to Android's original theme styles. */
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { min-height: 100%; overscroll-behavior-y: none; }
button, input, select { -webkit-tap-highlight-color: transparent; }
input, textarea, select { font-size: max(16px, 1em); }
@supports (padding: env(safe-area-inset-top)) {
  .theme-neon .side-rail {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    height: 100dvh;
  }
  .theme-neon .app-content {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(26px, env(safe-area-inset-bottom));
  }
  .license-gate {
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}
@media (display-mode: standalone) {
  body { -webkit-user-select: none; user-select: none; }
  input, textarea { -webkit-user-select: text; user-select: text; }
}

/*
 * iPhone/iPad ONLY — fix clipped Send summary tiles.
 * Android browsers and Townix-CardSender-Android are intentionally unaffected.
 */
@media screen and (max-width: 700px) {
  html.townix-ios .theme-neon #sendPanel > .stat-grid {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  html.townix-ios .theme-neon #sendPanel > .stat-grid > .stat-card {
    box-sizing: border-box;
    min-width: 0;
    min-height: 80px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: stretch;
    column-gap: 7px;
    row-gap: 2px;
    padding: 10px 8px;
    text-align: left;
  }
  html.townix-ios .theme-neon #sendPanel > .stat-grid > .stat-card:nth-child(3) {
    grid-column: 1 / -1;
  }
  html.townix-ios .theme-neon #sendPanel .stat-icon {
    grid-row: 1 / 3;
    grid-column: 1;
    width: 32px;
    height: 32px;
    margin: 0;
    font-size: 16px;
  }
  html.townix-ios .theme-neon #sendPanel .stat-card small {
    grid-column: 2;
    min-width: 0;
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .01em;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }
  html.townix-ios .theme-neon #sendPanel .stat-card strong {
    grid-column: 2;
    min-width: 0;
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
    white-space: nowrap;
  }
}
