@media screen and (max-width: 700px) {
  /* Anchor visually hidden table headings to their own scroll container. */
  .table-scroll {
    position: relative;
    max-width: 100%;
    overscroll-behavior-x: contain;
  }

  .top-inner { flex-wrap: wrap; gap: 5px 10px; padding-block: 7px; }
  .brand { flex-shrink: 0; }
  .brand-mark { flex-shrink: 0; }
  .account, .flow-account-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 8px;
    margin-left: auto;
    max-width: 100%;
  }
  .account > a.quiet { white-space: normal; }
  .account .quiet, .flow-account-nav .quiet { min-height: 42px; }
  .language-menu summary { display: flex; align-items: center; gap: 4px; min-height: 40px; }

  .section-nav-inner { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 0; }
  .section-nav-inner:has(> a:nth-child(3)) {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .section-nav a {
    justify-content: center;
    text-align: center;
    line-height: 1.35;
    min-height: 44px;
    padding: 6px 3px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .setting-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .setting-nav a { display: grid; place-items: center; min-height: 44px; text-align: center; overflow-wrap: anywhere; }
  .workspace-head > *, .ledger-head > *, .form-tools, .workspace-actions { min-width: 0; max-width: 100%; }
  .workspace-actions > *, .workspace-head .form-tools > *, .flow-welcome-actions a,
  .flow-workplace-row .primary, .flow-new-workplace button, .timeline-head .quiet {
    white-space: normal;
    text-align: center;
  }
  input:not([type="checkbox"], [type="radio"]), select, textarea { font-size: 16px; }
  .calendar-card { min-width: 0; }
  .timeline-head { flex-wrap: wrap; }
  .punch-actions button { flex: 1 1 42%; white-space: normal; }
  .flow-welcome-copy, .flow-welcome-actions, .flow-new-workplace { padding: 20px; }
  .flow-welcome-copy h1 { color: #fff; }

  /* Retain row identity when swiping across longer management tables. */
  :is(.daily-table, .people-table, .monthly-table, .period-summary-table) :is(th, td):first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--paper);
    box-shadow: 1px 0 0 var(--rail);
    min-width: 106px;
    max-width: 130px;
    overflow-wrap: anywhere;
  }
  :is(.daily-table, .people-table, .monthly-table, .period-summary-table) thead th:first-child,
  .people-table .is-selected :is(th, td):first-child {
    background: var(--surface);
  }
  .schedule-table th:first-child { min-width: 105px; max-width: 120px; white-space: normal; overflow-wrap: anywhere; }
  .schedule-table th:not(:first-child), .schedule-table td { min-width: 66px; }
  .schedule-cell { min-height: 42px; }
  .schedule-grid-tools, .schedule-grid-footer { gap: 8px; }
  .schedule-grid-tools button, .schedule-grid-footer button { min-height: 44px; white-space: normal; }

  /* Show a whole week, and keep vertical page scrolling available on touch. */
  .company-calendar-ledger .company-calendar { min-width: 0; }
  .company-calendar th { padding: 6px 1px; font-size: .72rem; }
  .company-calendar-day {
    gap: 2px;
    min-height: 57px;
    padding: 4px 2px;
    align-items: center;
    text-align: center;
    touch-action: pan-y pinch-zoom;
  }
  .company-calendar-day strong { font-size: .91rem; }
  .company-calendar-day span, .company-calendar-day small { font-size: .65rem; line-height: 1.3; }
}

@media screen and (max-width: 360px) {
  .flow-workplace-row .primary, .flow-new-workplace button { width: 100%; }
  .flow-welcome-copy, .flow-welcome-actions, .flow-new-workplace { padding: 16px; }
  .section-nav a { font-size: .77rem; }
  .company-calendar-day { padding-inline: 1px; }
}
