/* Mobile responsive overrides */

@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-wrap { padding: 0 0 32px; }
  body.protectedPage .app-wrap { width: 95%; padding: 0 0 32px; }
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; }
  .header-brand-row { width: 100%; align-items: center; }
  .header-stats { width: auto; display: flex; margin-left: auto; }
  .header-actions { width: 100%; align-items: flex-end; }
  .header-actions-row { width: 100%; justify-content: flex-end; }
  body.privacyPage .app-header,
  body.releaseNotesPage .app-header,
  body.tutorialPage .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  body.privacyPage .header-actions,
  body.releaseNotesPage .header-actions,
  body.tutorialPage .header-actions {
    width: 100%;
    margin-top: 8px;
    align-items: stretch;
  }
  body.privacyPage .header-actions-row,
  body.releaseNotesPage .header-actions-row,
  body.tutorialPage .header-actions-row {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  body.privacyPage .header-actions-row .btn-ghost,
  body.releaseNotesPage .header-actions-row .btn-ghost,
  body.tutorialPage .header-actions-row .btn-ghost {
    white-space: nowrap;
  }
  body.protectedPage .app-header { position: relative; flex-direction: row; align-items: center; justify-content: space-between; }
  body.protectedPage .mobile-menu-toggle {
    display: inline-flex;
    position: absolute;
    top: 6px;
    right: 0;
    z-index: 70;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    color: var(--text);
  }
  body.protectedPage .mobile-menu-toggle .bi {
    font-size: 1.85rem;
    line-height: 1;
  }
  body.protectedPage .header-actions {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    width: 100%;
    height: 100vh;
    padding: 10px 14px 24px;
    border: none;
    border-radius: 0;
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    z-index: 65;
    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    transition: transform .22s ease, opacity .2s ease;
  }
  body.protectedPage .mobile-menu-topbar {
    width: 100%;
    margin: 0 0 10px;
    padding-right: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }
  body.protectedPage .app-header.mobile-menu-open .header-actions {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  body.protectedPage .header-actions > .header-actions-row {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  body.protectedPage .mobile-menu-topbar .header-actions-row {
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    flex: 0 0 auto;
  }
  body.protectedPage .header-actions > .header-actions-row:first-of-type {
    flex: 0 0 auto;
    width: 100%;
    max-width: 360px;
    align-self: center;
    margin: 14px 0 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-alt);
    gap: 8px;
  }
  body.protectedPage .header-actions .btn-ghost {
    width: auto;
    min-height: 36px;
    justify-content: center;
    text-align: center;
    padding: 7px 8px;
    font-size: .82rem;
  }
  body.protectedPage .header-actions > .header-actions-row:first-of-type .btn-ghost {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-s);
    background: var(--surface);
    font-size: .88rem;
    font-weight: 700;
  }
  body.protectedPage .header-actions > .header-actions-row:first-of-type .btn-ghost:hover {
    background: var(--surface-hover);
  }
  body.protectedPage .header-actions .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }
  body.protectedPage .header-actions .lang-toggle {
    width: auto;
    justify-content: flex-start;
  }
  body.protectedPage .header-stats-in-menu {
    margin: 0;
    width: auto;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
  }
  body.protectedPage .header-stats-in-menu .stat-chip {
    min-height: 34px;
    justify-content: center;
  }
  body.dashboardPage .header-brand-row { flex-wrap: nowrap; }
  body.dashboardPage .app-header { padding: 8px 0 10px; }
  body.dashboardPage .header-stats .stat-chip { min-height: 32px; padding: 5px 8px; gap: 6px; }
  body.dashboardPage .header-stats .stat-value { font-size: .8rem; }
  .calendar-layout { grid-template-columns: 1fr; }
  #newClientFormWrap .form-grid-2 { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calendar-nav { width: 100%; justify-content: space-between; }
  .calendar-card .calendar-nav { width: auto; justify-content: flex-end; }
  .calendar-card .section-title { font-size: 1.05rem; }
  .calendar-card .calendar-nav-btn { width: 34px; height: 34px; }
  .calendar-period { min-width: 0; flex: 1; }
  #fixedDateWrap,
  #recurrenceConfig { grid-template-columns: 1fr !important; }
  .clients-table-grid { grid-template-columns: 1fr; }
  body.dashboardPage .clients-controls-stack {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    justify-items: stretch;
    gap: 6px;
  }
  body.dashboardPage .clients-export-row,
  body.dashboardPage .clients-multi-actions-row {
    width: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  body.dashboardPage .clients-export-row { grid-column: 1; flex-wrap: nowrap; width: 100%; justify-content: stretch; }
  body.dashboardPage .clients-export-row #exportClientsBtn { width: 100%; }
  body.dashboardPage .clients-export-row #clientsExportMsg:empty { display: none; }
  body.dashboardPage #multiSelectToggleBtn { grid-column: 2; width: 100%; }
  body.dashboardPage #groupReminderBtn { grid-column: 3; width: 100%; }
  body.dashboardPage .clients-multi-actions-row { display: none; grid-column: 1 / -1; width: 100%; }
  body.dashboardPage .clients-controls-stack.multi-select-active .clients-multi-actions-row {
    display: flex;
    grid-row: 2;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  body.dashboardPage .clients-controls-stack.multi-select-active .clients-multi-actions-row .btn-outline,
  body.dashboardPage .clients-controls-stack.multi-select-active .clients-multi-actions-row .btn-danger-subtle {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
  }
  body.dashboardPage #clientsExportMsg {
    width: auto;
    text-align: center;
    font-size: .78rem;
  }
  body.dashboardPage .clients-controls-stack .btn-outline,
  body.dashboardPage .clients-controls-stack .btn-danger-subtle {
    min-height: 34px;
    padding: 7px 10px;
    font-size: .8rem;
  }
  body.dashboardPage .clients-controls-stack .clients-page-size-input {
    width: auto;
    min-width: 118px;
    height: 34px;
    padding: 6px 8px;
    font-size: .8rem;
  }
  .client-item { padding: 12px 12px; gap: 10px; }
  .client-main-link { gap: 10px; min-width: 0; }
  .client-badge { padding: 4px 8px; }
  .client-actions { gap: 2px; }
  .cal-day { min-height: 56px; }
  body.authPage { overflow: auto; padding: 14px 10px; }
  body.authPage .container { max-width: 100%; padding-top: 8px; padding-bottom: 8px; }
  body.authPage .auth-header { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: nowrap; }
  body.authPage .auth-header .header-actions { width: auto; margin-left: auto; align-items: center; }
  body.authPage .login-landing { grid-template-columns: 1fr; gap: 12px; }
  body.authPage .login-story-card,
  body.authPage .auth-card { padding: 16px 14px; }
  body.authPage .auth-card { margin-bottom: 40px; }
  body.authPage .login-story-title { font-size: 1.28rem; }
  body.authPage .login-steps li { font-size: .87rem; }

  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topHeader { flex-direction: column; align-items: flex-start; }
  .headerRight { width: 100%; justify-content: flex-start; }
  .pricingGrid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-addons-panel { padding: 16px; border-radius: 18px; }
  .pricing-addons-options { grid-template-columns: 1fr; gap: 12px; }
  .pricing-addon-option { min-height: 0; padding: 16px; border-radius: 18px; }
  .pricing-addon-option .pricing-addon-name { font-size: 1.06rem; }
  .pricing-addon-price-amount { font-size: 2.15rem; }
}

@media (max-width: 480px) {
  .billing-stripe-grid { grid-template-columns: 1fr; }
  .summary-grid { gap: 8px; }
  .summary-card { padding: 12px; }
  .summary-count { font-size: 1.5rem; }
  .section-body { padding: 12px 16px 16px; }
  .section-top { padding: 12px 16px 0; }
  .client-item, .reminder-item { padding: 12px 16px; }
  body.authPage .auth-header .app-title { font-size: 1.45rem; }
  body.authPage .auth-title { font-size: 1.56rem; }
  body.authPage .login-story-title { font-size: 1.18rem; }
  body.authPage .auth-form label { margin-bottom: 9px; }
  body.authPage .auth-form input { min-height: 44px; }
  body.authPage .auth-form .btn { min-height: 44px; }
  body.dashboardPage .clients-controls-stack .btn-outline,
  body.dashboardPage .clients-controls-stack .btn-danger-subtle {
    padding: 6px 9px;
    font-size: .78rem;
  }
  body.dashboardPage .clients-controls-stack .clients-page-size-input {
    min-width: 108px;
    font-size: .78rem;
  }
  body.authPage #info:empty,
  body.authPage #err:empty { display: none; }

  .container { padding: 10px; }
  .card { padding: 14px; }
  .topHeader { padding: 12px; }
}
