/* Osrilo Build 88 source: mobile.css. Load order is defined in index.html. */
/* Step 20 — focused mobile layout and compact application header */
@media (max-width: 820px) {
  body {
    padding-top: 0;
    overflow-x: hidden;
  }

  .app-content,
  .dashboard-page,
  .dashboard-section,
  .time-clock-page {
    min-width: 0;
    max-width: 100%;
  }

  .app-topbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    margin: 0 -14px 12px;
    padding: calc(11px + env(safe-area-inset-top)) 16px 11px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: rgba(255,255,255,.97);
    box-shadow: 0 5px 18px rgba(15,23,42,.06);
    backdrop-filter: blur(14px);
  }

  .app-topbar-brand {
    align-items: center;
    gap: 11px;
    min-width: 0;
  }

  .dashboard-brand-logo {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 50%;
    box-shadow: 0 5px 14px rgba(15,23,42,.11);
  }

  .dashboard-brand-logo img {
    padding: 2px;
    border-radius: 50%;
  }

  .app-topbar-title .eyebrow {
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: .16em;
  }

  .app-topbar-title h1 {
    overflow: hidden;
    margin-top: -1px;
    font-size: clamp(27px, 8vw, 34px);
    line-height: 1.04;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-topbar-title .page-subtitle {
    display: none;
  }

  .app-account-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    margin: 0;
    text-align: left;
  }

  .app-account-panel .connection-row {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 9px;
    justify-content: flex-start;
    width: max-content;
    max-width: calc(100% - 150px);
    overflow: hidden;
    font-size: 11px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-account-panel .connection-dot {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 3px rgba(34,197,94,.13);
  }

  .app-account-panel .workspace-summary,
  .app-account-panel .signed-in-email {
    display: none;
  }

  .notification-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 18px;
  }

  .role-badge {
    max-width: 84px;
    overflow: hidden;
    padding: 7px 10px;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-topbar {
    padding-bottom: 29px;
  }

  .dashboard-page > .dashboard-section:first-child,
  .dashboard-page > .lead-form-card:first-child {
    margin-top: 0;
  }

  .section-heading,
  .page-header,
  .toolbar {
    align-items: stretch;
  }

  .section-heading {
    gap: 10px;
  }

  .section-heading h2,
  .page-heading h2 {
    font-size: 23px;
  }

  .section-help {
    max-width: none;
    text-align: left;
  }

  .stats-grid {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .stats-grid::-webkit-scrollbar { display: none; }
  .stat-card { scroll-snap-align: start; }

  .filter-bar,
  .estimate-filter-bar,
  .invoice-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 1px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filter-bar::-webkit-scrollbar,
  .estimate-filter-bar::-webkit-scrollbar,
  .invoice-filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar button,
  .estimate-filter-bar button,
  .invoice-filter-bar button {
    flex: 0 0 auto;
    min-height: 44px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .mobile-fab {
    right: 15px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    font-size: 32px;
  }

  .mobile-bottom-nav {
    min-height: 68px;
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
  }

  .mobile-nav-button {
    min-height: 56px;
    padding: 6px 2px;
    border-radius: 15px;
  }

  .mobile-action-sheet {
    max-height: min(76vh, 610px);
  }

  .mobile-sheet-heading {
    margin-bottom: 10px;
  }

  .mobile-sheet-heading h2 {
    font-size: 27px;
  }

  .mobile-more-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .mobile-more-grid button {
    min-height: 68px;
    padding: 10px;
    justify-content: flex-start;
  }

  .mobile-more-grid button > span {
    width: 38px;
    height: 38px;
  }

  .mobile-more-grid button strong {
    font-size: 13px;
    line-height: 1.2;
  }
}

@media (max-width: 650px) {
  .dashboard-section,
  .lead-form-card,
  .access-card {
    padding: 15px;
  }

  .page-intro-card .section-heading,
  .estimate-tools,
  .invoice-tools,
  .jobs-tools {
    gap: 10px;
  }

  .dashboard-section .section-heading,
  .page-intro-card .section-heading {
    flex-direction: column;
  }

  .dashboard-section .section-heading > button,
  .page-intro-card .section-heading > button,
  .estimate-tools > button,
  .invoice-tools > button,
  .jobs-tools > button {
    width: 100%;
    min-height: 50px;
  }

  .estimate-card-main,
  .invoice-card-main,
  .material-card-main,
  .lead-card {
    padding: 14px;
  }

  .lead-card-header,
  .estimate-card-main,
  .invoice-card-main {
    min-width: 0;
  }

  .lead-card-header h3,
  .estimate-card h3,
  .invoice-card h3 {
    overflow-wrap: anywhere;
  }

  .lead-card-actions,
  .estimate-card-actions,
  .invoice-card-actions,
  .material-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
  }

  .lead-card-actions button,
  .estimate-card-actions button,
  .invoice-card-actions button,
  .material-card-actions button {
    width: 100%;
    min-height: 48px;
    padding: 10px 8px;
    line-height: 1.2;
  }

  .lead-card-actions .next-step-button,
  .estimate-card-actions .next-step-button,
  .invoice-card-actions .primary-action,
  .lead-card-actions .danger-button:last-child:nth-child(odd),
  .estimate-card-actions .danger-button:last-child:nth-child(odd),
  .invoice-card-actions .danger-button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .form-grid,
  .estimate-editor-grid,
  .invoice-editor-grid {
    grid-template-columns: 1fr;
  }

  .full-width,
  .estimate-title-field {
    grid-column: auto;
  }

  input,
  textarea,
  select {
    min-height: 48px;
    font-size: 16px;
  }

  textarea {
    min-height: 105px;
  }

  .lead-form-actions,
  .modal-actions,
  .estimate-editor-actions,
  .invoice-editor-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lead-form-actions button,
  .modal-actions button,
  .estimate-editor-actions button,
  .invoice-editor-actions button {
    width: 100%;
    min-height: 49px;
  }

  .estimate-item-row,
  .invoice-item-row {
    scroll-margin-top: 92px;
  }

  .notification-panel {
    top: calc(88px + env(safe-area-inset-top));
  }

  .empty-state {
    padding: 20px 14px;
    font-size: 14px;
  }
}

@media (max-width: 390px) {
  .app-topbar {
    grid-template-columns: minmax(0,1fr) auto;
    padding-left: 12px;
    padding-right: 12px;
  }

  .dashboard-brand-logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .app-topbar-title h1 {
    font-size: 27px;
  }

  .role-badge {
    display: none;
  }

  .app-account-panel .connection-row {
    left: 12px;
    max-width: calc(100% - 76px);
  }

  .lead-card-actions,
  .estimate-card-actions,
  .invoice-card-actions,
  .material-card-actions,
  .mobile-more-grid {
    grid-template-columns: 1fr;
  }

  .lead-card-actions .next-step-button,
  .estimate-card-actions .next-step-button,
  .invoice-card-actions .primary-action {
    grid-column: auto;
  }
}


