/* Narrow layout for the same screens. Loaded last so it can be removed on its own.
   Desktop rules above 800px stay in the other stylesheets. */

.cx { min-width: 0; }

@media (max-width: 800px) {
  .cx .hdr { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
  .cx .logo-name { display: none; }
  .cx .nav { flex-wrap: nowrap; gap: 2px; min-width: 0; }
  .cx .nav a { padding: 6px 8px; }
  .cx #nav-settings { display: none; }
  .cx .avi.set { display: block; }
  .cx .toast { white-space: normal; max-width: calc(100% - 24px); }
  .cx .pop { max-width: calc(100% - 12px); max-height: calc(100% - 12px); overflow: auto; }
  /* Actions menu: a submenu (Partially Done, Postpone) opens inside the menu, below its item, and pushes
     the following items down. Floating it over them let later items paint on top of it (ALM-123). */
  .cx .cmenu { max-width: calc(100% - 12px); max-height: calc(100% - 12px); overflow-y: auto; overscroll-behavior: contain; }
  .cx .ci[data-parent] { flex-wrap: wrap; }
  .cx .ci[data-parent].open,
  .cx .ci[data-parent].open:hover { background: #f1f4f8; }
  .cx .sub, .cx .sub.left,
  .cx .cmenu .sub { position: static; flex-basis: 100%; width: auto; margin: 6px -4px -3px; padding: 4px; border: 0; border-radius: 7px; box-shadow: none; background: #fff; }
  .cx .ci:not(.dis):hover > .sub { display: none; }
  .cx .ci.open > .sub,
  .cx .ci.open:hover > .sub { display: block; }
  .cx .overlay { overflow: auto; align-items: flex-start; padding: 12px 8px 24px; }
  .cx .modal,
  .cx .sc-pop,
  .cx .tbf {
    width: auto;
    min-width: 0;
    max-width: calc(100% - 8px);
  }
  .cx .frow { flex-wrap: wrap; }
  .cx .fpop,
  .cx .fpop.wide { max-width: calc(100vw - 16px); }
  .cx .dfwrap { flex-direction: column; }
  .cx .dfmain { width: auto; max-width: 100%; }
  .cx .dfquick { width: auto; border-left: 0; border-top: 1px solid #eef1f5; padding: 8px 0 0; }
  .cx input,
  .cx select,
  .cx textarea { font-size: 16px; }

  .cx .scr-signin .si { grid-template-columns: 1fr; grid-auto-rows: max-content; overflow-y: auto; }
  .cx .scr-signin .si-left { padding: 28px 20px; }
  .cx .scr-signin .si-right { padding: 16px 20px; border-left: 0; border-top: 1px solid #e3e8ef; }
  .cx .scr-signin .si-desktop-week { display: none; }
  .cx .scr-signin .si-mobile-week { display: block; flex: 1; min-width: 0; }

  .cx .scr-setup .su-hdr { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .cx .scr-setup .su-stepper { flex: 1 1 180px; }
  .cx .scr-setup .su-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .cx .scr-setup .su-left { border-right: 0; }
  .cx .scr-setup .su-right { display: none; }
  .cx .sc-chip.saved .sc-edit { display: flex; position: static; transform: none; }

  .cx .bar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .cx .wtitle { min-width: 0; }
  .cx .quick { flex: 1 1 160px; }
  /* calendar-interaction.feature "Display compact time block cards in the mobile calendar": no lock or repeat
     icons on cards; fixed blocks get an outline instead. Checked by scripts/check-demo.js. */
  .cx .scr-calendar .blk .lk,
  .cx .scr-calendar .blk .rp { display: none; }
  .cx .scr-calendar .grid { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  /* outline is drawn on the border box, so it also covers the category stripe on the left */
  .cx .scr-calendar .blk.fixed { outline: 1.5px solid #49515e; outline-offset: -1.5px; }

  .cx .lv { position: relative; }
  .cx .lbar h3 { display: none; }
  .cx .lside { display: inline-flex; }
  .cx .lside::before {
    content: "";
    width: 16px;
    height: 16px;
    background: #3b4656;
    -webkit-mask: url("../img/filter.png") center / contain no-repeat;
    mask: url("../img/filter.png") center / contain no-repeat;
  }
  .cx .lside.p { background: #eaf4fd; border-color: #8ec5f5; }
  .cx .lside.p::before { background: #1d6fb8; }
  .cx .side {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    max-height: none;
    z-index: 6;
    border: 0;
    padding: 12px 12px 28px;
  }
  .cx .lv.side-open .side { display: block; }
  .cx .side-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 10px; }
  .cx .side-title { font-weight: 700; font-size: 16px; }
  .cx .lbar { align-items: center; }
  .cx .lbar #l-info { white-space: normal; }
  .cx .lrow .rbs { opacity: 1; pointer-events: auto; }

  .cx .rvscroll { padding: 12px 12px 70px; }
  .cx .rcard { padding: 14px 12px; -webkit-tap-highlight-color: transparent; }
  .cx .rnav, .cx .racts .kb, .cx .ahead .desktop-only { display: none; }
  .cx .ahead .mobile-only { display: block; }

  .cx .scr-settings .st { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .cx .scr-settings .st-side { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid #e3e8ef; }
  .cx .scr-settings .st-t { padding: 0 6px 0 0; }
  .cx .scr-settings .st-side a { padding: 6px 8px; }
  .cx .scr-settings .st-main { padding: 12px 12px 48px; }
  .cx .scr-settings .st-ch,
  .cx .scr-settings .st-set { flex-wrap: wrap; align-items: flex-start; }
  .cx .scr-settings .st-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.2fr) 24px; }
  .cx .scr-settings .st-row.ts { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto 24px; }
  .cx .scr-settings .st-sel { min-width: 0; max-width: 100%; }
}
