/*
 * Mobile-first accessibility and layout safety net.
 *
 * This file is intentionally loaded after every product/theme stylesheet. It
 * only affects phone/tablet widths, so desktop composition remains unchanged.
 */

@media (max-width: 700px) {
  :root {
    --mobile-gutter: clamp(12px, 4vw, 18px);
    --mobile-radius: 18px;
    --mobile-control: 48px;
  }

  html {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(72px + env(safe-area-inset-top));
  }

  body,
  .app-shell,
  .main-shell,
  #app,
  #page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  body {
    min-height: 100dvh;
    overscroll-behavior-y: none;
  }

  img,
  video,
  canvas,
  svg {
    max-width: 100%;
  }

  /* Navigation remains usable on narrow phones and notches. */
  .topbar {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: calc(66px + env(safe-area-inset-top));
    gap: 8px;
    padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  }

  .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }

  .breadcrumb {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
  }

  .breadcrumb strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    min-width: 0;
    flex: 0 0 auto;
    gap: 5px;
  }

  .mobile-menu,
  .icon-btn,
  .web-theme-toggle-icon,
  .unit-switcher,
  .ecosystem-switcher-trigger {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }

  .sidebar {
    box-sizing: border-box;
    width: min(88vw, 320px);
    height: 100dvh;
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-right: 14px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar .nav-item,
  .sidebar .panel-mode-status,
  .sidebar .panel-mode-selector button {
    min-height: 46px;
    font-size: 13px;
  }

  .sidebar-scrim {
    padding: 0;
    touch-action: none;
  }

  .panel-practical .mobile-bottom-nav {
    right: 0;
    bottom: 0;
    left: 0;
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding-right: max(5px, env(safe-area-inset-right));
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    padding-left: max(5px, env(safe-area-inset-left));
  }

  .mobile-bottom-nav button {
    min-height: 54px;
    padding: 6px 3px;
    font-size: 11px;
    line-height: 1.15;
  }

  .mobile-bottom-nav button span {
    white-space: normal;
  }

  .page {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 18px var(--mobile-gutter) calc(98px + env(safe-area-inset-bottom));
  }

  .panel-practical .page {
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }

  /* Functional copy never falls into unreadable microtext. */
  .page :is(p, li, dd, dt, label, small, time, .cell-sub, .field-hint, .metric-note),
  .modal :is(p, li, label, small, .field-hint),
  .guided-setup-dialog :is(p, li, label, small, .field-hint),
  .proposal-public :is(p, li, label, small),
  .public-care-shell :is(p, li, label, small) {
    font-size: max(12px, 0.75rem);
    line-height: 1.45;
  }

  .page :is(h1, h2, h3, h4, p, strong, small, span, a, button),
  .modal :is(h1, h2, h3, p, strong, small, span, a, button),
  .guided-setup-dialog :is(h1, h2, h3, p, strong, small, span, a, button) {
    overflow-wrap: anywhere;
  }

  .page-head,
  .section-head,
  .toolbar {
    max-width: 100%;
  }

  .page-head {
    align-items: stretch;
    gap: 12px;
  }

  .page-head h1 {
    font-size: clamp(29px, 9vw, 38px);
  }

  .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .section-actions,
  .row-actions,
  .document-head-actions,
  .toolbar-group {
    max-width: 100%;
    flex-wrap: wrap;
  }

  /* 44px is the minimum interaction target throughout the product. */
  :is(.btn, .tab, .chip, .nav-item, .icon-btn, .modal-close, .guided-close),
  .page :is(button, a[role="button"]),
  .modal :is(button, a[role="button"]),
  .guided-setup-dialog :is(button, a[role="button"]) {
    min-height: 44px;
  }

  .btn,
  .tab,
  .page button,
  .modal button,
  .guided-setup-dialog button {
    font-size: max(12px, 0.75rem);
  }

  .row-actions :is(button, a),
  .document-head-actions :is(button, a) {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea,
  .input,
  .select,
  .textarea,
  .searchable-select-input {
    width: 100%;
    min-width: 0;
    min-height: var(--mobile-control);
    font-size: 16px !important;
  }

  textarea,
  .textarea {
    min-height: 112px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 22px;
    min-width: 22px;
    height: 22px;
  }

  .field,
  .form-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .card,
  .panel,
  .workspace,
  .metric,
  .analytics-card,
  .clinic-home-panel {
    min-width: 0;
    max-width: 100%;
  }

  .form-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Dense tab sets use one horizontal rail instead of wrapping into pages. */
  :is(.tabs, .report-tabs, .commercial-tabs, .record-nav, .settings-tabs, .insurance-workspace > .tabs) {
    display: flex;
    max-width: 100%;
    gap: 5px;
    padding-bottom: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }

  :is(.tabs, .report-tabs, .commercial-tabs, .record-nav, .settings-tabs)::-webkit-scrollbar {
    display: none;
  }

  :is(.tabs, .report-tabs, .commercial-tabs, .record-nav, .settings-tabs) > :is(button, a, .tab) {
    min-width: 94px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: normal;
  }

  .record-nav {
    grid-template-columns: none;
    margin-inline: calc(var(--mobile-gutter) * -1);
    padding-inline: var(--mobile-gutter);
  }

  .record-nav button {
    width: 98px;
    min-width: 98px;
    min-height: 66px;
  }

  /* Full-height bottom sheets do not hide actions under browser chrome. */
  .modal-backdrop {
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
    overflow: hidden;
  }

  .modal {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-radius: 0;
  }

  .modal-head {
    position: sticky;
    z-index: 7;
    top: 0;
    min-height: calc(64px + env(safe-area-inset-top));
    padding: calc(12px + env(safe-area-inset-top)) var(--mobile-gutter) 12px;
    flex: 0 0 auto;
    background: var(--surface);
  }

  .modal-head h2 {
    min-width: 0;
    font-size: clamp(21px, 6vw, 27px);
  }

  .modal-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .modal-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px var(--mobile-gutter) 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal-actions {
    position: sticky;
    z-index: 8;
    bottom: 0;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    margin: 24px calc(var(--mobile-gutter) * -1) 0;
    padding: 12px var(--mobile-gutter) calc(12px + env(safe-area-inset-bottom));
  }

  .modal-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
  }

  /* Guided onboarding, room publication and inventory imports. */
  .guided-setup-backdrop {
    padding: 0;
    overflow: hidden;
  }

  .guided-setup-dialog,
  .rental-flow-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .guided-setup-head {
    min-height: calc(62px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) var(--mobile-gutter) 10px;
  }

  .guided-setup-head strong {
    font-size: 14px;
  }

  .guided-setup-layout {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .guided-setup-sidebar {
    padding: 9px var(--mobile-gutter);
  }

  .guided-setup-sidebar nav {
    gap: 7px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .guided-setup-sidebar nav button {
    min-width: 144px;
    min-height: 52px;
    scroll-snap-align: start;
  }

  .guided-setup-sidebar nav :is(strong, small) {
    font-size: 12px;
  }

  .guided-setup-main,
  .rental-flow-main {
    min-height: 0;
    padding: 22px var(--mobile-gutter) 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .guided-step-copy {
    margin-bottom: 20px;
  }

  .guided-step-copy h2 {
    font-size: clamp(29px, 9vw, 38px);
  }

  .guided-step-fields,
  .rental-flow-fields {
    width: 100%;
    max-width: none;
  }

  .guided-choice-grid,
  .rental-choice-grid,
  .rental-choice-grid-compact,
  .rental-check-grid,
  .rental-review-grid,
  .guided-whatsapp-options,
  .inventory-upload-methods,
  .inventory-summary-metrics,
  .inventory-summary-items {
    grid-template-columns: minmax(0, 1fr);
  }

  .guided-choice-grid label > span,
  .rental-choice,
  .rental-check-grid label > span,
  .guided-whatsapp-options > label {
    min-height: 64px;
  }

  .guided-choice-grid strong,
  .rental-choice strong,
  .rental-check-grid strong,
  .guided-whatsapp-options strong {
    font-size: 14px;
  }

  .guided-setup-actions {
    bottom: 0;
    gap: 9px;
    margin: 28px calc(var(--mobile-gutter) * -1) 0;
    padding: 12px var(--mobile-gutter) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(16px);
  }

  .guided-setup-actions > div {
    min-width: 0;
  }

  .guided-setup-actions .btn {
    min-width: 0;
    min-height: 50px;
  }

  /* Agenda and clinical workspace. */
  .calendar-strip {
    width: 100%;
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .calendar-strip button {
    min-width: 0;
    min-height: 52px;
    padding-inline: 2px;
  }

  .agenda-row {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 9px;
    min-height: 68px;
  }

  .agenda-row > :is(.badge, .row-actions) {
    grid-column: 2;
    justify-self: start;
  }

  .appointment-choice-group,
  .appointment-payer-grid,
  .appointment-main-choices,
  .appointment-date-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .appointment-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .appointment-slot-card {
    min-width: 0;
    min-height: 72px;
  }

  .appointment-procedure-grid {
    max-height: min(38dvh, 310px);
  }

  .record-header,
  .record-header-actions,
  .record-selector,
  .record-patient {
    min-width: 0;
    max-width: 100%;
  }

  .record-header-actions {
    width: 100%;
  }

  .record-pdf-action {
    width: 48px;
    height: 48px;
  }

  .dental-chart,
  .quote-dental-chart {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  /* Tables stay contained. Rows with data labels become readable cards. */
  .table-wrap,
  .documents-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap > .table:not(.documents-table) {
    min-width: 680px;
  }

  .table th,
  .table td {
    padding: 12px;
    font-size: 12px;
  }

  .table tbody tr:has(td[data-label]) {
    min-width: 0;
  }

  /* HOF, dashboard, embedded Outside/GetWork and Supply. */
  .clinic-home-heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .clinic-home-heading-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    justify-content: center;
    gap: 6px;
    padding-inline: 8px;
    font-size: clamp(11px, 3.35vw, 14px);
    line-height: 1.15;
    white-space: nowrap;
  }

  .clinic-home-heading-actions .btn svg {
    width: 17px;
    min-width: 17px;
  }

  .hof-hero,
  .operations-hero,
  .rental-command,
  .subscription-hero {
    padding: 22px var(--mobile-gutter);
    border-radius: var(--mobile-radius);
  }

  .hof-hero h2,
  .operations-hero h1,
  .rental-command h2 {
    font-size: clamp(31px, 9vw, 40px);
  }

  .hof-treatment-grid,
  .hof-protocol-grid,
  .aftercare-plan-grid,
  .hof-protocol-picker,
  .hof-channel-options,
  .hof-review,
  .hof-detail-grid,
  .network-commerce,
  .supply-market-layout,
  .subscription-plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .supply-mobile-categories button {
    min-height: 94px;
    font-size: 12px;
    line-height: 1.3;
  }

  .supply-mobile-address :is(small, strong),
  .supply-mobile-search-trigger,
  .supply-mobile-category :is(small, button),
  .supply-product-body :is(small, span),
  .supply-product-delivery,
  .network-mobile-categories button,
  .network-mobile-search-trigger :is(strong, small),
  .network-space-body :is(p, small) {
    font-size: 12px;
  }

  .supply-mobile-cart-bar {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    min-height: 54px;
  }

  .supply-mobile-cart-bar :is(small, strong) {
    font-size: 13px;
  }

  .network-grid,
  .supply-mobile-category > div,
  .clinic-home-summary {
    scroll-padding-inline: var(--mobile-gutter);
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Financial, reports and communication workspaces. */
  .analytics-filterbar {
    scroll-padding-inline: 10px;
  }

  .analytics-kpi-grid,
  .communication-health-grid,
  .report-overview-grid,
  .report-insight-grid,
  .report-main-grid,
  .report-detail-grid,
  .financial-primary-grid,
  .communication-summary,
  .communication-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-kpi {
    min-height: 112px;
  }

  .analytics-kpi :is(small, p),
  .analytics-secondary-strip small,
  .analytics-card :is(p, small),
  .report-bar-list :is(strong, small),
  .communication-health :is(p, small, strong) {
    font-size: 12px;
  }

  .financial-workspace,
  .report-workspace,
  .communication-workspace {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: 12px;
    border-radius: var(--mobile-radius);
  }

  .financial-workspace .table,
  .report-workspace .table {
    min-width: 680px;
  }

  .financial-insights-grid {
    grid-auto-columns: min(88vw, 360px);
  }

  .communication-health {
    padding: 15px;
  }

  .communication-health > header,
  .communication-health > footer {
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column;
    align-items: stretch;
  }

  .communication-health > header .btn,
  .communication-health > footer .btn {
    width: 100%;
  }

  .report-bar-list > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-funnel {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-funnel > i {
    width: 2px;
    height: 16px;
    justify-self: center;
  }

  .report-funnel > i::after {
    top: auto;
    right: auto;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

  .report-funnel > span.report-funnel-value b {
    font-size: clamp(18px, 6vw, 23px);
  }

  /* Public checkout and signed patient journeys. */
  .proposal-public,
  .public-care-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top)) var(--mobile-gutter) calc(26px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }

  .proposal-public-layout,
  .proposal-installments,
  .proposal-billing-grid,
  .proposal-card-grid,
  .public-care-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .proposal-public-header {
    align-items: flex-start;
    gap: 8px;
  }

  .proposal-secure {
    max-width: 48%;
  }

  .proposal-progress {
    margin-bottom: 22px;
  }

  .proposal-greeting h1,
  .proposal-finished h1,
  .proposal-error h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .proposal-selection,
  .proposal-payment,
  .proposal-summary,
  .public-care-card {
    padding: 15px;
    border-radius: var(--mobile-radius);
  }

  .proposal-item {
    grid-template-columns: 24px 40px minmax(0, 1fr);
    gap: 9px;
  }

  .proposal-item > b {
    grid-column: 3;
    justify-self: start;
  }

  .proposal-methods label {
    min-height: 70px;
  }

  .proposal-summary {
    position: static;
    width: 100%;
  }

  .proposal-summary .btn {
    min-height: 52px;
  }

  .proposal-finished,
  .proposal-error {
    margin: 24px auto;
    padding: 24px var(--mobile-gutter);
  }

  /* Floating actions reserve space and never cover the last card. */
  .contextual-fab:not([hidden]) {
    max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }

  body:has(.contextual-fab:not([hidden])) .page {
    padding-bottom: calc(164px + env(safe-area-inset-bottom));
  }

  body:has(.supply-mobile-cart-bar:not([hidden])) .page {
    padding-bottom: calc(174px + env(safe-area-inset-bottom));
  }

  #toast-region {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
  }
}

@media (max-width: 430px) {
  .topbar-settings {
    display: none;
  }

  .breadcrumb {
    font-size: 11px;
  }

  .breadcrumb strong {
    font-size: 14px;
  }

  .page {
    padding-inline: 12px;
  }

  .analytics-kpi-grid,
  .home-finance-grid,
  .subscription-plan-limits,
  .insurance-remuneration-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .appointment-choice-group,
  .appointment-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-actions,
  .guided-setup-actions > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .guided-setup-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .guided-setup-actions > div,
  .guided-setup-actions .btn {
    width: 100%;
  }

  .proposal-secure small {
    display: none;
  }

  .proposal-secure {
    padding: 8px;
  }

  .report-fact-list,
  .analytics-mini-summary,
  .communication-health-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 350px) {
  .topbar {
    padding-inline: 8px;
  }

  .topbar-actions {
    gap: 3px;
  }

  .unit-switcher,
  .web-theme-toggle-icon,
  .ecosystem-switcher-trigger,
  .mobile-menu {
    width: 42px;
    min-width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .appointment-slot-grid,
  .appointment-choice-group {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-bottom-nav button {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Late phone refinements for entry, install and compact business summaries. */
@media (max-width: 700px) {
  .grid-4,
  .analytics-kpi-grid,
  .commercial-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-shell,
  .subscription-recovery-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    overflow-x: clip;
  }

  .auth-form-wrap {
    width: 100%;
    min-width: 0;
    padding: calc(18px + env(safe-area-inset-top)) var(--mobile-gutter) calc(22px + env(safe-area-inset-bottom));
  }

  .auth-card {
    width: 100%;
    max-width: 440px;
    min-width: 0;
    padding: 26px 18px;
    border-radius: 22px;
  }

  .auth-card h1 {
    font-size: clamp(35px, 11vw, 48px);
    overflow-wrap: anywhere;
  }

  .auth-card :is(p, small, label, a) {
    font-size: 13px;
    line-height: 1.45;
  }

  .auth-card :is(.btn, button) {
    min-height: 50px;
    font-size: 14px;
  }

  .initial-plan-backdrop {
    padding: 0;
    overflow: hidden;
  }

  .initial-plan-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    padding: calc(20px + env(safe-area-inset-top)) var(--mobile-gutter) calc(20px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 0;
  }

  .initial-plan-card {
    min-width: 0;
    min-height: 0;
  }

  .initial-plan-submit {
    width: 100%;
    min-height: 52px;
  }

  .ecosystem-switcher-panel {
    right: max(0px, env(safe-area-inset-right));
    width: min(360px, calc(100vw - 20px));
    max-height: calc(100dvh - 82px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .ecosystem-switcher-panel nav button,
  .ecosystem-switcher-panel :is(.ecosystem-account-action, .ecosystem-logout) {
    min-height: 48px;
  }

  .ecosystem-switcher-panel :is(strong, small, button, a) {
    font-size: 12px;
  }

  .settings-menu button {
    min-height: 60px;
  }

  .settings-menu button > span > :is(strong, small),
  .settings-mobile-back {
    font-size: 12px;
  }

  .boot {
    min-height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) var(--mobile-gutter) calc(18px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

@media (max-width: 350px) {
  .grid-4,
  .analytics-kpi-grid,
  .commercial-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .guided-team-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .guided-team-summary .btn {
    width: 100%;
  }

  .guided-professional-roster {
    display: flex;
    gap: 9px;
    margin-inline: calc(var(--mobile-gutter) * -1);
    padding-inline: var(--mobile-gutter);
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .guided-professional-card {
    flex: 0 0 min(82vw, 290px);
    min-height: 76px;
    scroll-snap-align: start;
  }

  .guided-professional-editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .professional-identity-section {
    margin-inline: -4px;
    padding: 14px;
  }

  .professional-single-source-note,
  .guided-team-summary,
  .guided-professional-card {
    font-size: 12px;
  }
}

@media (max-width: 700px) {
  .rental-location-grid,
  .rental-structure-summary {
    gap: 0;
  }

  .rental-option-groups {
    gap: 12px;
    margin-top: 10px;
  }

  .rental-option-group {
    padding: 13px;
    border-radius: var(--mobile-radius);
  }

  .rental-option-group > header {
    gap: 10px;
    margin-bottom: 11px;
  }

  .rental-option-group > header strong {
    font-size: 14px;
  }

  .rental-option-group > header small,
  .rental-receiving-toggle small {
    font-size: 12px;
    line-height: 1.45;
  }

  .rental-option-group > header > span {
    padding: 5px 7px;
    font-size: 10px;
  }

  .rental-option-group .rental-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .rental-option-group .rental-check-grid label > span {
    min-height: 60px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.3;
  }

  .rental-receiving-card {
    padding: 13px;
    border-radius: var(--mobile-radius);
  }

  .rental-receiving-toggle > span {
    grid-template-columns: 38px minmax(0, 1fr) 24px;
    gap: 10px;
  }

  .rental-receiving-toggle > span > svg:first-child {
    width: 38px;
    height: 38px;
  }

  .rental-receiving-toggle strong {
    font-size: 13px;
  }

  .rental-cep-status {
    min-height: 44px;
    margin-top: 0;
    padding: 10px 12px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  .rental-option-group .rental-check-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rental-option-group > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .rental-receiving-toggle > span {
    grid-template-columns: 34px minmax(0, 1fr) 24px;
  }

  .rental-receiving-toggle > span > svg:first-child {
    width: 34px;
    height: 34px;
    padding: 8px;
  }
}
