/* AF ShopBook V31.23 — Customer Portal mobile polish
   Presentation-only. No auth, payment, subscription, or data behavior changes. */

@media (max-width: 760px) {
  .portal-shell {
    width: calc(100% - 20px);
  }

  /* Compact, stable mobile navigation. */
  .portal-nav {
    min-height: 64px;
    gap: 8px;
  }

  .portal-brand-v26 {
    flex: 0 1 124px;
    width: 124px;
    height: 35px;
  }

  .portal-nav-actions {
    gap: 5px;
  }

  .back-site,
  .icon-btn,
  .lang-btn {
    min-height: 40px;
    border-radius: 11px;
  }

  .back-site {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .icon-btn {
    width: 40px;
  }

  .lang-btn {
    padding-inline: 8px;
  }

  .lang-btn #langLabel {
    display: none;
  }

  .lang-btn img {
    width: 21px;
    height: 14px;
  }

  /* Reduce empty vertical space in the dashboard. */
  .dashboard-view {
    padding: 12px 0 54px;
  }

  .dashboard-topbar {
    display: block;
    min-height: 0;
    margin-bottom: 12px;
    padding: 16px 118px 16px 16px;
    border-radius: 18px;
  }

  html[dir="ltr"] .dashboard-topbar {
    padding: 16px 16px 16px 118px;
  }

  .dashboard-topbar::before {
    width: 4px;
  }

  .dashboard-topbar .portal-kicker {
    min-height: 27px;
    padding-inline: 10px;
    font-size: .67rem;
  }

  .dashboard-topbar h1 {
    margin-top: 9px;
    font-size: 1.28rem;
    line-height: 1.25;
  }

  .dashboard-topbar p {
    margin-top: 4px;
    font-size: .68rem;
    overflow-wrap: anywhere;
  }

  .logout-btn {
    position: absolute;
    inset-block-start: 14px;
    inset-inline-end: 14px;
    width: auto;
    min-height: 40px;
    height: 40px;
    padding-inline: 10px;
    border-radius: 11px;
    font-size: .68rem;
  }

  .logout-btn svg {
    width: 17px;
    height: 17px;
  }

  /* Subscription summary: cleaner hierarchy and less height. */
  .subscription-hero {
    border-radius: 18px;
  }

  .subscription-main {
    padding: 18px 15px;
  }

  .subscription-main::before {
    top: 20px;
    height: 62px;
  }

  .subscription-title-row {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .subscription-title-row h2 {
    font-size: 1.72rem;
  }

  .subscription-title-row span:not(.status-pill) {
    font-size: .67rem;
  }

  .status-pill {
    min-height: 29px;
    padding-inline: 10px;
    font-size: .64rem;
  }

  .subscription-main > p {
    margin: 11px 0 14px;
    font-size: .74rem;
    line-height: 1.65;
  }

  .subscription-dates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .subscription-dates div {
    min-height: 62px;
    padding: 10px 8px;
    border-radius: 11px;
    text-align: center;
  }

  .subscription-dates span {
    font-size: .57rem;
    line-height: 1.35;
  }

  .subscription-dates b {
    margin-top: 4px;
    font-size: .68rem;
  }

  .subscription-action {
    min-height: 0;
    padding: 17px 15px;
    gap: 7px;
  }

  .subscription-action .action-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .subscription-action b {
    margin-top: 6px;
    font-size: .86rem;
  }

  .subscription-action p {
    margin: 3px 0 8px;
    font-size: .68rem;
    line-height: 1.55;
  }

  .subscription-action button {
    min-height: 43px;
    font-size: .74rem;
  }

  .subscription-support {
    margin-top: 1px;
    font-size: .66rem;
  }

  /* Summary cards become compact without losing the device-limit message. */
  .stats-grid {
    gap: 8px;
    margin: 10px 0;
  }

  .stats-grid article {
    min-height: 84px;
    padding: 13px 14px;
    gap: 11px;
    border-radius: 15px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .stat-icon svg {
    width: 20px;
    height: 20px;
  }

  .stats-grid span {
    font-size: .63rem;
  }

  .stats-grid b {
    font-size: 1.12rem;
  }

  .stats-grid small {
    margin-top: 3px;
    font-size: .58rem;
    line-height: 1.5;
    white-space: normal;
  }

  /* Panels and headings: consistent compact mobile rhythm. */
  .panel {
    padding: 16px 14px;
    border-radius: 17px;
  }

  .panel-heading {
    gap: 10px;
    padding-bottom: 12px;
  }

  .panel-heading span {
    font-size: .62rem;
  }

  .panel-heading h3 {
    font-size: .96rem;
    line-height: 1.45;
  }

  .panel-heading > svg {
    width: 23px;
    height: 23px;
  }

  .feature-plan-badge,
  .locked-feature-badge {
    font-size: .6rem;
    padding: 5px 8px;
  }

  /* Entitlements remain readable but use much less height. */
  .entitlements-grid {
    gap: 7px;
    margin-top: 12px;
  }

  .entitlement-item {
    min-height: 62px;
    padding: 10px 42px 10px 10px;
    border-radius: 11px;
  }

  html[dir="ltr"] .entitlement-item {
    padding: 10px 10px 10px 42px;
  }

  .entitlement-item > span {
    inset-inline-start: 10px;
    width: 24px;
    height: 24px;
    font-size: .68rem;
  }

  .entitlement-item b {
    font-size: .69rem;
    line-height: 1.45;
  }

  .entitlement-item small {
    margin-top: 2px;
    font-size: .57rem;
    line-height: 1.45;
  }

  .feature-upgrade-link {
    margin-top: 10px;
    min-height: 40px;
    font-size: .68rem;
  }

  /* Inventory cards: 2x2 metrics and tighter records. */
  .inventory-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
  }

  .inventory-metrics article {
    min-height: 69px;
    padding: 10px;
    border-radius: 11px;
  }

  .inventory-metrics span {
    font-size: .59rem;
  }

  .inventory-metrics b {
    margin-top: 3px;
    font-size: 1rem;
  }

  .inventory-full-block,
  .inventory-advanced-block {
    margin-top: 10px;
    padding: 12px;
    border-radius: 13px;
  }

  .inventory-subheading b,
  .inventory-advanced-block b {
    font-size: .72rem;
  }

  .inventory-advanced-block small,
  .feature-lock-callout small {
    font-size: .58rem;
    line-height: 1.5;
  }

  .inventory-records article {
    min-height: 57px;
    padding: 9px 10px;
    border-radius: 11px;
  }

  /* Payment requests: keep the action visible beside the title. */
  .payment-panel {
    margin: 10px 0;
  }

  .payment-panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .new-request-btn {
    min-height: 40px;
    padding-inline: 10px;
    border-radius: 11px;
    font-size: .67rem;
  }

  .new-request-btn svg {
    width: 17px;
    height: 17px;
  }

  .payment-history-state {
    min-height: 82px;
    margin-top: 12px;
  }

  .payment-history-state b {
    font-size: .74rem;
  }

  .payment-history-state small {
    font-size: .61rem;
  }

  /* Account/access cards and footer. */
  .dashboard-grid {
    gap: 10px;
  }

  .account-panel dl > div {
    min-height: 0;
    padding: 9px 0;
  }

  .account-panel dt {
    font-size: .62rem;
  }

  .account-panel dd {
    font-size: .7rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .access-list {
    gap: 9px;
    margin: 13px 0;
  }

  .access-list li {
    font-size: .67rem;
    line-height: 1.55;
  }

  .portal-warning {
    padding: 10px;
    border-radius: 11px;
  }

  .portal-warning p {
    font-size: .62rem;
    line-height: 1.55;
  }

  .portal-footer .portal-shell {
    padding: 15px 0 72px;
    gap: 10px;
    font-size: .62rem;
  }

  .portal-footer nav {
    gap: 9px 12px;
  }

  /* Smaller assistant launcher that does not cover footer/card content. */
  .af-assistant-root {
    inset-inline-start: 9px !important;
    bottom: max(9px, env(safe-area-inset-bottom)) !important;
  }

  .af-assistant-launcher {
    width: 42px !important;
    height: 42px !important;
    padding: 4px !important;
    border-radius: 12px !important;
  }

  .af-assistant-launcher .af-assistant-logo {
    width: 34px !important;
    max-height: 28px !important;
  }
}

@media (max-width: 390px) {
  .portal-shell {
    width: calc(100% - 16px);
  }

  .portal-brand-v26 {
    flex-basis: 112px;
    width: 112px;
    height: 32px;
  }

  .dashboard-topbar {
    padding-inline-start: 14px;
    padding-inline-end: 104px;
  }

  html[dir="ltr"] .dashboard-topbar {
    padding-inline-start: 104px;
    padding-inline-end: 14px;
  }

  .logout-btn span {
    display: none;
  }

  .logout-btn {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .subscription-dates {
    grid-template-columns: 1fr 1fr;
  }

  .subscription-dates div:last-child {
    grid-column: 1 / -1;
  }
}
