@media (max-width: 800px) {
  :root {
    --shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
  }

  button,
  .board,
  .panel-card,
  .kpis article,
  .calendar-course {
    transition: none;
  }

  button:hover,
  .board:hover,
  .panel-card:hover,
  .kpis article:hover {
    transform: none;
    box-shadow: var(--shadow);
  }

  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: #f8fafc;
    overscroll-behavior-x: none;
  }

  html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: auto;
  }

  button,
  select,
  input,
  textarea,
  .tab,
  .calendar-course,
  .calendar-block {
    -webkit-tap-highlight-color: transparent;
  }

  .child-merge-tool {
    grid-template-columns: 1fr;
  }

  .app {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0;
  }

  .login-view {
    min-height: 100dvh;
    padding: max(16px, var(--safe-top)) 14px max(16px, var(--safe-bottom));
  }

  .login-card {
    width: 100%;
    max-width: 430px;
    padding: 24px 20px;
  }

  .main-view {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    height: auto;
    border-top: 1px solid rgba(228, 231, 236, 0.92);
    border-right: 0;
    border-bottom: 0;
    padding: 8px 10px calc(8px + var(--safe-bottom));
    box-shadow: 0 -12px 34px rgba(16, 24, 40, 0.12);
  }

  .brand,
  .nav-group-label,
  .tab small {
    display: none;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding-bottom: 2px;
  }

  .tabs::-webkit-scrollbar,
  .workflow-actions::-webkit-scrollbar,
  .quick-actions::-webkit-scrollbar,
  .active-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .tab {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 56px;
    padding: 6px 4px;
    text-align: center;
    font-size: 12px;
  }

  .tab[data-page="masterPage"],
  .tab[data-page="adminPage"] {
    display: none;
  }

  .tab span {
    grid-row: auto;
    width: 28px;
    height: 28px;
  }

  .tab strong {
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab[data-page="homePage"] strong {
    max-width: none;
  }

  .content-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    padding: 0 12px calc(96px + var(--safe-bottom));
  }

  .topbar {
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0 -12px 12px;
    padding: max(12px, var(--safe-top)) 12px 10px;
    border-bottom-color: rgba(228, 231, 236, 0.82);
  }

  .topbar,
  .board-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-right {
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .workflow-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    gap: 8px;
    padding-bottom: 0;
  }

  .workflow-actions button {
    width: 100%;
    min-width: 0;
    flex: none;
    justify-content: center;
    min-height: 44px;
    padding: 0 10px;
  }

  .workflow-actions [data-workflow-action="add"],
  .workflow-actions [data-workflow-action="export"] {
    display: inline-flex;
  }

  .workflow-actions [data-workflow-action="scheduled"],
  .workflow-actions [data-workflow-action="conflict"],
  .workflow-actions [data-workflow-action="overdue"] {
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
  }

  .workflow-actions [data-workflow-action="scheduled"] {
    display: inline-flex;
  }

  .user-chip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    justify-content: space-between;
  }

  .controls,
  .board,
  .panel-card,
  .kpis article {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .user-chip span,
  .user-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding-left: 8px;
    padding-right: 8px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-chip #roleLabel {
    grid-column: 1 / -1;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  input,
  select,
  textarea,
  .primary-button,
  .ghost-button,
  .danger-button {
    min-height: 44px;
  }

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