/* Variant 1 · Shelf: a calm bookshelf for matters. Sidebar + slim top bar; covers and live workspace previews. */
.pl-app[data-variant="shelf"] {
  --sh-side: 232px;
  & .pi-sh-back { --i: url("../icons/chevron-left.svg"); }
  & .pi-sh-gear { --i: url("../icons/appearance.svg"); }

  /* ---------- top bar ---------- */
  & .sh-top { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px 0 0; background: var(--pc-chrome); border-bottom: 1px solid var(--pc-border); }
  & .sh-brand { flex: none; display: flex; align-items: center; gap: 10px; width: var(--sh-side); box-sizing: border-box; padding-left: 18px; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; }
  & .sh-brand img { width: 28px; height: 28px; flex: none; }
  & .sh-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; max-width: 520px; height: 36px; padding: 0 8px 0 10px; border: 1px solid var(--pc-border); border-radius: 10px; background: var(--pc-bg); color: var(--pc-text-2); cursor: text; transition: border-color 150ms ease, box-shadow 150ms ease; }
  & .sh-search:focus-within { border-color: var(--pc-focus); box-shadow: 0 0 0 3px var(--pc-select-wash); }
  & .sh-search .pi { width: 16px; height: 16px; }
  & .sh-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--pc-text); font: inherit; outline: none; }
  & .sh-search input::placeholder { color: var(--pc-text-2); }
  & .sh-search:focus-within .pc-kbd { visibility: hidden; }
  & .sh-fill { flex: 1; }

  /* ---------- sidebar ---------- */
  & .pl-side { width: var(--sh-side); display: flex; flex-direction: column; overflow: hidden; background: var(--pc-chrome); border-right: 1px solid var(--pc-border); }
  & .sh-side__scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px 10px; }
  & .sh-side__list { display: grid; gap: 1px; }
  & .sh-side__foot { padding: 8px 10px 12px; border-top: 1px solid var(--pc-border); }
  & .sh-side__head { display: flex; align-items: center; gap: 2px; margin-top: 14px; }
  & .sh-side__add { width: 28px; height: 28px; flex: none; }
  & .sh-side__gap { height: 14px; }
  & .sh-row { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--pc-text); font-size: 13.5px; text-align: left; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease, box-shadow 150ms ease; }
  & .sh-row .pi { width: 17px; height: 17px; color: var(--pc-text-2); }
  & .sh-row[aria-current="page"] { background: var(--pc-select-wash); font-weight: 600; }
  & .sh-row[aria-current="page"] .pi { color: var(--pc-select); }
  & .sh-row:focus-visible { outline-offset: -2px; }
  & .sh-row__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  & .sh-row__count { color: var(--pc-text-2); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
  & .sh-frow { display: flex; align-items: center; padding-left: calc(var(--d, 0) * 14px); }
  /* depth as a data attribute, not a style attribute: the site's Content-Security-Policy blocks style attributes */
  & .sh-frow[data-depth="1"] { --d: 1; }
  & .sh-frow[data-depth="2"] { --d: 2; }
  & .sh-frow[data-depth="3"] { --d: 3; }
  & .sh-frow[data-depth="4"] { --d: 4; }
  & .sh-frow[data-depth="5"] { --d: 5; }
  & .sh-frow[data-depth="6"] { --d: 6; }
  & .sh-frow .sh-row { padding-left: 4px; }
  & .sh-disc { flex: none; display: grid; place-items: center; width: 20px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--pc-text-2); cursor: pointer; }
  & .sh-disc .pi { width: 12px; height: 12px; }
  & .is-drop, & .is-drop[aria-current="page"] { background: var(--pc-select-wash); box-shadow: inset 0 0 0 2px var(--pc-select); }

  /* ---------- page ---------- */
  & .pl-main { background: var(--pc-bg); }
  & .sh-page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 112px; }
  & .sh-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; }
  & .sh-head__text { min-width: 0; flex: 1 1 320px; }
  & h1 { margin: 0; font: 400 32px/1.15 "DS Newsreader", Georgia, serif; letter-spacing: -0.01em; overflow-wrap: anywhere; }
  & h1:focus { outline: none; }
  & .sh-lede { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 0; color: var(--pc-text-2); }
  & .sh-head__tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
  & .sh-head__actions, & .sh-head__cell { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  & .sh-starbtn[aria-pressed="true"] { color: var(--pc-accent); }
  & .sh-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 6px -6px; padding: 0; list-style: none; }
  & .sh-crumbs li { display: flex; align-items: center; min-width: 0; }
  & .sh-crumbs li::after { content: "›"; margin: 0 2px; color: var(--pc-text-2); }
  & .sh-crumb { height: 26px; max-width: 280px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--pc-text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
  & .sh-sec { margin-top: 36px; }
  & .sh-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 14px; }
  & .sh-sec h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
  & .sh-sec__head .pc-btn .pi-chevron-right { width: 14px; height: 14px; margin: 0 -4px 0 -2px; }
  & .sh-empty { margin: 0; padding: 22px 20px; border: 1px dashed var(--pc-border-strong); border-radius: 12px; color: var(--pc-text-2); text-align: center; }
  & .sh-meta { color: var(--pc-text-2); font-size: 12.5px; font-weight: 400; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  & .sh-star { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; color: var(--pc-accent); }
  & .sh-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  & .sh-tag { padding: 1px 7px; border-radius: 999px; background: var(--pc-accent-wash); font-size: 11.5px; font-weight: 600; }

  /* ---------- grids and the things in them ---------- */
  & .sh-grid { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
  & .sh-grid--cards { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
  & .sh-grid--covers { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 26px 20px; }
  & .sh-grid--folders { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
  & .sh-grid--shelf { grid-template-columns: repeat(4, minmax(0, 180px)); gap: 28px clamp(12px, 1.6vw, 24px); } /* Continue reading holds at most four: one shelf */
  & .sh-shelf { padding: 24px 24px 20px; border-radius: 18px; background: var(--pc-surface-2); }
  & .sh-cell { position: relative; min-width: 0; }
  & .sh-item { transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, box-shadow 200ms var(--ease-out); }
  & .sh-item:active, & .sh-row:active, & .sh-chip:active, & .sh-crumb:active, & .sh-radio:active { transform: scale(0.97); }
  & .sh-more { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; background: var(--pc-surface); color: var(--pc-text); box-shadow: var(--pc-shadow-1); transition: transform 160ms var(--ease-out), opacity 150ms ease, background-color 150ms ease; }

  /* matter cards: the root workspace on top */
  & .sh-pcard__open { display: flex; flex-direction: column; width: 100%; padding: 0; border: 1px solid var(--pc-card-border); border-radius: 14px; background: var(--pc-card); text-align: left; cursor: pointer; overflow: hidden; box-shadow: var(--pc-shadow-1); }
  & .sh-pic { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--pc-surface-2); }
  & .sh-pcard__open .sh-pic { border-bottom: 1px solid var(--pc-card-border); }
  & .sh-pic canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
  & .sh-pic__empty { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 6px; color: var(--pc-text-2); font-size: 12px; }
  & .sh-pic__empty .pi { width: 20px; height: 20px; opacity: .6; }
  & .sh-pic.is-empty .sh-pic__empty { display: grid; }
  & .sh-pic.is-empty canvas { visibility: hidden; }
  & .sh-pcard__body { display: grid; gap: 2px; padding: 12px 14px 14px; min-width: 0; }
  & .sh-pcard__title { margin-bottom: 2px; font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

  /* file covers: a book standing on the shelf */
  & .sh-cover__open { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 0; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
  & .sh-cover__book { position: relative; display: block; margin-bottom: 10px; }
  & .sh-cover__book .pc-thumb { width: 100%; border-radius: 3px; box-shadow: 0 0 0 1px var(--pc-border), var(--pc-shadow-2); transition: box-shadow 200ms var(--ease-out); }
  & .sh-cover__title { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  & .sh-cover--big .sh-cover__title { font-size: 14.5px; }
  & .sh-cover .sh-more { top: 6px; right: 6px; width: 28px; height: 28px; }
  & .sh-badge { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: var(--pc-primary); color: var(--pc-on-primary); font-size: 11px; font-weight: 600; box-shadow: var(--pc-shadow-1); }

  /* folder tiles */
  & .sh-ftile__open { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; width: 100%; padding: 14px 46px 14px 14px; border: 1px solid var(--pc-card-border); border-radius: 12px; background: var(--pc-card); text-align: left; cursor: pointer; }
  & .sh-ftile__open .pi { grid-row: span 2; width: 26px; height: 26px; color: var(--pc-accent); }
  & .sh-ftile__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  & .sh-ftile .sh-more { top: 50%; margin-top: -15px; }

  /* workspaces: the main one, then each workspace with the ones inside it */
  & .sh-ws { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px 20px; align-items: start; margin: 0; padding: 0; list-style: none; }
  & .sh-wtile__open { display: grid; gap: 2px; width: 100%; padding: 0; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
  & .sh-wtile__open .sh-pic { margin-bottom: 8px; border: 1px solid var(--pc-card-border); border-radius: 12px; overflow: hidden; box-shadow: var(--pc-shadow-1); transition: box-shadow 200ms var(--ease-out), border-color 150ms ease; }
  & .sh-wtile--main .sh-pic { border-color: color-mix(in srgb, var(--pc-accent) 45%, var(--pc-card-border)); }
  & .sh-wtile__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  & .sh-wsgroup__label { margin: 12px 0 8px 14px; color: var(--pc-text-2); font-size: 12px; }
  & .sh-wsgroup__kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--pc-border); list-style: none; }
  & .sh-wtile--kid .sh-pic { margin-bottom: 4px; border-radius: 8px; }
  & .sh-wtile--kid .sh-wtile__title { font-size: 12.5px; }
  & .sh-wtile--kid .sh-more { top: 4px; right: 4px; width: 26px; height: 26px; }

  /* files grouped by project folder */
  & .sh-fgroup + .sh-fgroup { margin-top: 28px; }
  & .sh-fgroup h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13.5px; font-weight: 600; }
  & .sh-fgroup h3 .pi { width: 16px; height: 16px; color: var(--pc-text-2); }

  /* chips, sort */
  & .sh-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
  & .sh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  & .sh-chip { height: 30px; padding: 0 12px; border: 1px solid var(--pc-border); border-radius: 999px; background: var(--pc-surface); color: var(--pc-text); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease; }
  & .sh-chip--sm { height: 24px; padding: 0 9px; font-size: 12px; }
  & .sh-chip[aria-pressed="true"] { border-color: var(--pc-primary); background: var(--pc-primary); color: var(--pc-on-primary); }
  & .sh-toolbar + .sh-sec { margin-top: 22px; }

  /* archived and Recycle Bin rows */
  & .sh-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--pc-card-border); border-radius: 14px; background: var(--pc-card); overflow: hidden; }
  & .sh-lrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; }
  & .sh-lrow + .sh-lrow { border-top: 1px solid var(--pc-border); }
  & .sh-lrow__icon { color: var(--pc-text-2); }
  & .sh-lrow__text { display: grid; gap: 2px; flex: 1 1 240px; min-width: 0; }
  & .sh-lrow__title { font-weight: 600; overflow-wrap: anywhere; }
  & .sh-lrow .sh-meta { white-space: normal; }
  & .sh-lrow .pc-btn[aria-disabled="true"] { opacity: .45; cursor: default; }

  /* settings popover */
  & .sh-settings { width: 264px; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--pc-border); border-radius: 14px; background: var(--pc-surface); box-shadow: var(--pc-shadow-3); }
  & .sh-settings__h { margin: 4px 2px 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--pc-text-2); }
  & .sh-settings .pc-seg { display: flex; }
  & .sh-settings__list { display: grid; gap: 1px; }
  & .sh-settings__act { display: flex; align-items: center; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--pc-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
  @media (hover: hover) and (pointer: fine) { & .sh-settings__act:hover { background: var(--pc-hover); } }
  @media (pointer: coarse) { & .sh-settings__act { min-height: 44px; } }
  & .sh-radio { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
  & .sh-radio__dot { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--pc-border-strong); transition: box-shadow 150ms ease; }
  & .sh-radio[aria-checked="true"] .sh-radio__dot { box-shadow: inset 0 0 0 4.5px var(--pc-select); }
  & .sh-settings__note { margin: 2px 2px 0; color: var(--pc-text-2); font-size: 12px; }
}

@media (hover: hover) and (pointer: fine) {
  .pl-app[data-variant="shelf"] {
    & .sh-row:hover, & .sh-disc:hover, & .sh-crumb:hover, & .sh-radio:hover { background: var(--pc-hover); }
    & .sh-row[aria-current="page"]:hover { background: var(--pc-select-wash); }
    & .sh-chip:hover { border-color: var(--pc-border-strong); }
    & .sh-chip[aria-pressed="false"]:hover { background: var(--pc-surface-2); }
    & .sh-search:hover:not(:focus-within) { border-color: var(--pc-border-strong); }
    & .sh-pcard__open:hover, & .sh-ftile__open:hover { border-color: var(--pc-border-strong); box-shadow: var(--pc-shadow-2); }
    & .sh-wtile__open:hover .sh-pic { border-color: var(--pc-border-strong); box-shadow: var(--pc-shadow-2); }
    & .sh-cover__open:hover .pc-thumb { box-shadow: 0 0 0 1px var(--pc-border-strong), var(--pc-shadow-3); }
    & .sh-more:hover { background: var(--pc-surface-2); }
    /* the menu button waits until the card is pointed at or focused (always shown without a fine pointer) */
    & .sh-cell .sh-more { opacity: 0; }
    & .sh-cell:hover .sh-more, & .sh-cell:focus-within .sh-more, & .sh-more[aria-expanded="true"] { opacity: 1; }
    &.sh-dragging .sh-cell .sh-more { opacity: 0; }
  }
}

/* 900 px and 200% zoom: tighter margins, then the sidebar folds to icons */
@media (max-width: 1100px) { .pl-app[data-variant="shelf"] .sh-page { padding: 24px 24px 112px; } }
@media (min-width: 700px) and (max-width: 800px) {
  .pl-app[data-variant="shelf"] {
    --sh-side: 60px;
    & .sh-brand { padding-left: 16px; }
    & .sh-brand span, & .sh-tree, & .sh-side__add, & .sh-row__count, & .sh-search .pc-kbd { display: none; }
    & .sh-row__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    & .sh-row { justify-content: center; padding: 0; }
    & .sh-side__scroll, & .sh-side__foot { padding-inline: 8px; }
    & .sh-side__head { margin-top: 8px; }
    & .sh-top { padding-right: 12px; }
    & .sh-page { padding: 20px 18px 112px; }
    & .sh-grid--shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 12px; }
    & .sh-shelf { padding: 18px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .pl-app[data-variant="shelf"] { & .sh-item:active, & .sh-chip:active, & .sh-crumb:active, & .sh-radio:active, & .sh-row:active { transform: none; } }
}

/* ---------- the phone (under 700 px; owner, 18 Nov 2026) ----------
   No side rail: menu, title, search and New in the top bar; the sidebar as a drawer. Matters are compact rows with
   no workspace pictures; files keep their covers. Every control is at least 44 px. */
.pl-app[data-variant="shelf"] .sh-menu, .pl-app[data-variant="shelf"] .sh-title, .pl-app[data-variant="shelf"] .sh-searchbtn, .pl-app[data-variant="shelf"] .sh-scrim { display: none; }
@media (max-width: 699px) {
  .pl-app[data-variant="shelf"] {
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
    & .sh-top { height: auto; min-height: 56px; gap: 4px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(4px, env(safe-area-inset-left)); }
    & .sh-brand, & .sh-fill, & .sh-search .pc-kbd { display: none; }
    & .sh-menu, & .sh-searchbtn { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; }
    & .sh-title { display: block; flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 700; }
    & .sh-back { flex: none; width: 44px; height: 44px; }
    & .sh-menu { order: 0; } & .sh-back { order: 1; } & .sh-title { order: 2; } & .sh-search { order: 2; } & .sh-searchbtn { order: 3; } & .sh-new { order: 4; }
    & .sh-new { flex: none; width: 44px; height: 44px; padding: 0; font-size: 0; gap: 0; }
    & .sh-new .pi { width: 20px; height: 20px; }
    & .sh-search { display: none; }
    &.sh-search-open .sh-search { display: flex; flex: 1; max-width: none; height: 44px; }
    &.sh-search-open .sh-title, &.sh-search-open .sh-searchbtn, &.sh-search-open .sh-new, &.sh-search-open .sh-back { display: none; }
    & .sh-search input { font-size: 16px; }

    /* the drawer */
    & .pl-side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(304px, 86vw); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left); box-shadow: var(--pc-shadow-3); transform: translateX(-100%); visibility: hidden; transition: transform 300ms var(--ease-drawer), visibility 0s linear 300ms; }
    &.sh-drawer-open .pl-side { transform: none; visibility: visible; transition: transform 300ms var(--ease-drawer), visibility 0s; }
    & .sh-scrim { display: block; position: fixed; z-index: 55; inset: 0; background: rgba(8, 20, 30, .38); opacity: 0; visibility: hidden; transition: opacity 300ms ease, visibility 0s linear 300ms; }
    &.sh-drawer-open .sh-scrim { opacity: 1; visibility: visible; transition: opacity 300ms ease, visibility 0s; }
    & .sh-row { height: 44px; }
    & .sh-side__add { width: 44px; height: 44px; }
    & .sh-disc { width: 32px; height: 44px; }

    /* pages */
    & .sh-page { padding: 16px max(16px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
    & .sh-head { flex-direction: column; align-items: stretch; gap: 12px; }
    & .sh-head__text { flex: none; }
    & .sh-head h1 { font-size: 24px; }
    & .sh-title-in-bar .sh-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* named once, in the bar; still the page's heading */
    & .sh-head__actions, & .sh-head__cell { display: flex; flex-wrap: wrap; gap: 8px; }
    & .sh-sec { margin-top: 24px; }

    /* compact matter rows */
    & .sh-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
    & .sh-mrow, & .sh-wrow { position: relative; display: flex; align-items: stretch; gap: 0; border: 1px solid var(--pc-border); border-left-width: 4px; border-left-color: transparent; border-radius: 12px; background: var(--pc-surface); overflow: hidden; }
    & .sh-mrow--urgent { border-left-color: #C44761; }
    & .sh-mrow--listing { border-left-color: var(--pc-accent); }
    & .sh-mrow__open, & .sh-wrow__open { flex: 1; min-width: 0; display: grid; gap: 3px; align-content: center; min-height: 64px; padding: 10px 4px 10px 12px; border: 0; background: transparent; color: var(--pc-text); font: inherit; text-align: left; cursor: pointer; }
    & .sh-wrow__open { display: flex; align-items: center; gap: 12px; }
    & .sh-wrow__open > .pi { flex: none; width: 20px; height: 20px; color: var(--pc-text-2); }
    & .sh-wrow__text { display: grid; gap: 3px; min-width: 0; }
    & .sh-mrow__title { font-weight: 600; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
    & .sh-mrow__foot { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
    & .sh-mrow .sh-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
    & .sh-mrow .sh-meta, & .sh-wrow .sh-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    & .sh-mrow .sh-star-btn, & .sh-mrow .sh-more, & .sh-wrow .sh-more { position: static; flex: none; align-self: center; width: 44px; height: 44px; margin: 0; background: transparent; box-shadow: none; opacity: 1; }
    & .sh-star-btn[aria-pressed="true"] { color: var(--pc-accent); }
    & .sh-more-note { margin: 8px 2px 0; }
    & .sh-mrow__open:active, & .sh-wrow__open:active { background: var(--pc-hover); }

    /* Continue reading: one scrolling row of covers, two and a third in view, snapping */
    & .sh-shelf { padding: 14px 0 14px 14px; border-radius: 14px; }
    & .sh-grid--shelf { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 2 * 12px) / 2.33); gap: 12px; overflow-x: auto; padding-right: 14px; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
    & .sh-grid--shelf::-webkit-scrollbar { display: none; }
    & .sh-grid--shelf > li { scroll-snap-align: start; }
    & .sh-cover__title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

    /* files: two covers across; folders one per row */
    & .sh-grid--covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
    & .sh-grid--folders { grid-template-columns: minmax(0, 1fr); }
    & .sh-ftile .sh-more { width: 44px; height: 44px; }
    /* a cover's menu: a 44 px target, drawn as a small soft dot so it does not cover the page's corner */
    & .sh-cover .sh-more { top: 0; right: 0; width: 44px; height: 44px; background: transparent; box-shadow: none; color: var(--pc-text); }
    & .sh-cover .sh-more::before { content: ""; position: absolute; top: 9px; right: 9px; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--pc-surface) 78%, transparent); box-shadow: 0 0 0 1px var(--pc-border); }
    & .sh-cover .sh-more .pi { position: relative; width: 14px; height: 14px; }
    /* shorter covers on a phone: a one-page file is not a tall empty sheet */
    & .sh-grid--covers .pc-thumb, & .sh-grid--shelf .pc-thumb { aspect-ratio: 1 / 1; }
    & .sh-toolbar { display: flex; }
    & .sh-sortbtn { min-height: 44px; }
  }
}
@media (max-width: 699px) and (prefers-reduced-motion: reduce) {
  .pl-app[data-variant="shelf"] { & .pl-side, &.sh-drawer-open .pl-side { transition: visibility 0s; transform: none; opacity: 0; } &.sh-drawer-open .pl-side { opacity: 1; transition: opacity 150ms ease; } }
}

/* Tablet: the menu button folds the sidebar to icons (and back); the phone uses it for the drawer instead. */
@media (min-width: 700px) and (max-width: 1099px) {
  .pl-app[data-variant="shelf"] .sh-menu { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: 6px; }
  .pl-app[data-variant="shelf"].sh-side-collapsed {
    --sh-side: 60px;
    & .sh-brand span, & .sh-tree, & .sh-side__add, & .sh-row__count { display: none; }
    & .sh-row__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    & .sh-row { justify-content: center; padding: 0; }
    & .sh-side__scroll, & .sh-side__foot { padding-inline: 8px; }
  }
}
/* Touch at any size: the menu button over a cover, a matter card or a workspace preview is a light circle on a
   44 px target (a solid surface square read as a dark block in dark mode). */
@media (pointer: coarse) {
  .pl-app[data-variant="shelf"] {
    & :is(.sh-cover, .sh-pcard, .sh-wtile) .sh-more { top: 0; right: 0; width: 44px; height: 44px; margin: 0; background: transparent; box-shadow: none; color: var(--pc-text); }
    & :is(.sh-cover, .sh-pcard, .sh-wtile) .sh-more::before { content: ""; position: absolute; top: 9px; right: 9px; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--pc-surface) 78%, transparent); box-shadow: 0 0 0 1px var(--pc-border); }
    & :is(.sh-cover, .sh-pcard, .sh-wtile) .sh-more .pi { position: relative; width: 14px; height: 14px; }
  }
}
