/* Shared final layout rules: keep translated copy inside its grid/flex cell. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.app-stage,
.app-content,
.panel,
.field,
.modal-head > div,
.page-heading > div,
.dashboard-grid > *,
.dashboard-lower > *,
.cards-grid > *,
.account-grid > *,
.recipient-grid > *,
.currency-grid > *,
.details-layout > *,
.request-layout > *,
.support-layout > *,
.profile-grid > *,
.trading-layout > *,
.wf-grid > *,
.field-row > *,
.app-hero-grid > *,
.catalog-hero-grid > *,
.transfer-hero-grid > *,
.transfer-action-layout > *,
.technology-hero-panel > *,
.footer-grid > * {
  min-width: 0;
}

.page-heading h1,
.panel h2,
.modal-head h2,
.catalog-hero h1,
.transfer-page-hero h1,
.technology-hero-copy h1,
.section-title {
  overflow-wrap: break-word;
  hyphens: auto;
}

.panel-head {
  flex-wrap: wrap;
  gap: 10px 16px;
}

.panel-head > h2 {
  min-width: 0;
  flex: 1 1 130px;
}

.panel-head > .text-link {
  flex-shrink: 0;
}

.page-heading {
  flex-wrap: wrap;
  gap: 18px 24px;
}

.page-heading-actions {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.balance-value,
.account-value {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.transaction-right,
.card-bottom > div:first-child {
  min-width: 0;
}

.currency-card,
.account-card,
.recipient-card,
.profile-card {
  min-width: 0;
}

.currency-card > strong,
.profile-card > p,
.profile-card > h2,
.profile-id {
  overflow-wrap: anywhere;
}

.currency-card > strong {
  font-variant-numeric: tabular-nums;
}

.transaction-right > strong,
.card-bottom strong {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.card-bottom {
  gap: 8px;
}

.card-bottom strong {
  line-height: 1.2;
}

.card-bottom > div:first-child {
  flex: 1;
}

@supports (container-type: inline-size) {
  .card-bottom > div:first-child {
    container-type: inline-size;
  }
  .card-bottom strong,
  .card-details-dialog .card-bottom strong {
    font-size: clamp(10px, calc(170cqi / var(--amount-length, 12)), 23px);
    white-space: nowrap;
  }
}

.card-bottom-side {
  flex-shrink: 0;
}

.card-shell-actions,
.account-actions,
.wf-actions,
.app-footer > div,
.footer-policy-links {
  flex-wrap: wrap;
}

.btn,
.text-link {
  max-width: 100%;
}

.modal-actions > .btn {
  min-width: 0;
  white-space: normal;
}

.dropdown-menu {
  max-width: calc(100vw - 32px);
}

.dropdown-menu > button,
.detail-row > strong,
.account-number,
.recipient-number > span {
  overflow-wrap: anywhere;
}

@media (min-width: 761px) {
  .transaction-text > strong,
  .transaction-right > strong,
  .data-table td,
  .card-shell-actions .btn {
    font-size: 12px;
  }
  .transaction-text > small,
  .transaction-right .badge {
    font-size: 10px;
  }
}

@media (max-width: 760px) {
  .btn {
    white-space: normal;
    overflow-wrap: break-word;
  }

  .field input,
  .field textarea,
  .field select,
  .select-trigger,
  .reply-form textarea {
    font-size: 16px;
  }

  .client-layout .page-heading p,
  .client-layout .balance-caption,
  .client-layout .balance-currencies,
  .client-layout .transaction-text > small,
  .client-layout .transaction-right .badge,
  .app-footer {
    color: var(--muted);
  }

  .client-layout .mobile-quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-quick-actions > a {
    min-width: 0;
    font-size: 11px;
    overflow-wrap: break-word;
  }

  .mobile-bottom-nav > a > .material-symbols-rounded {
    width: 48px;
    height: 30px;
    padding: 3px 12px;
  }

  .mobile-bottom-nav > a > span:last-child {
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
    overflow-wrap: break-word;
    hyphens: auto;
    text-overflow: clip;
  }

  .client-layout .app-stage {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }

  .client-layout .balance-value {
    font-size: clamp(30px, 10vw, 42px);
  }

  .app-footer > div {
    gap: 12px 18px;
  }

  .app-topbar .icon-btn,
  .drawer-close {
    width: 40px;
    height: 40px;
  }

  .app-topbar,
  .auth-header {
    padding-top: max(10px, env(safe-area-inset-top, 0px));
  }

  .catalog-hero h1,
  .transfer-page-hero h1 {
    font-size: clamp(34px, 8vw, 48px);
  }

  .card-shell-actions .btn {
    min-height: 44px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  /* Give the operation title and amount separate lines on narrow phones. */
  .client-layout .transaction-row {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr);
    gap: 6px 12px;
    align-items: start;
  }

  .client-layout .transaction-icon {
    grid-row: 1 / 3;
    align-self: center;
  }

  .client-layout .transaction-text > strong {
    max-width: none;
    white-space: normal;
    line-height: 1.45;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .client-layout .transaction-right {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
    text-align: left;
  }

  .client-layout .transaction-right > strong {
    white-space: normal;
    font-size: 13px;
  }

  .client-layout .transaction-right .badge {
    margin-top: 0;
    font-size: 10px;
  }

  .client-layout .panel-head > .text-link {
    font-size: 11px;
    gap: 6px;
  }

  .client-layout .app-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .app-topbar-right {
    gap: 6px;
  }

  .card-application .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .card-details-dialog .modal-head h2,
  .card-application .modal-head h2 {
    font-size: 21px;
  }
}
