@layer blocks {
  /* Narrow sheet: the input docks to the bottom of the writing column; the
     list switcher stays at the top of the sheet so a stack of lists does not
     land in the compose bar. */
  .search form {
    box-shadow: var(--shadow-hairline-above);
    padding: var(--space-2) 0 var(--space-half);
    position: fixed;
    inset-inline-start: calc(var(--sheet-pad) + var(--notebook-spine) + var(--notebook-spine-gutter));
    inset-inline-end: var(--sheet-pad);
    inset-block-end: 0;
    background: var(--color-bg);
    z-index: 50;
  }

  /* Wide sheet: a sticky bar one cell tall, so the first task row lands on a
     dot row. Opaque on purpose: the notebook dot grid is painted on <body>,
     and this bar has to cover it while the list scrolls underneath. */
  @container notebook (width > 55rem) {
    .search {
      position: sticky;
      inset-block-start: var(--sticky-offset, 0);
      background: var(--color-bg);
      z-index: 50;
    }

    .search form {
      position: static;
      padding: 0;
      box-shadow: none;
      background: none;
    }
  }
}
