:root {
  --resource-orange: #d65b2f;
  --resource-paper: #f4efe5;
  --resource-panel: #fff;
  --resource-border: #d9d1c4;
  --resource-shadow: 0 18px 50px rgba(65, 45, 23, .08);
}

.resource-home-main { width: min(calc(100% - 40px), 1440px) !important; max-width: 1440px !important; padding-top: 16px !important; }
.resource-home-main .site-return { margin-bottom: 12px; }
.resource-home-hero,
.resource-browser-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 14px 0 12px; }
.resource-home-hero { margin-top: 10px; }
.resource-home-hero h1 { margin-block: 2px 6px; }
.resource-browser-head h1 { margin: 0; }
.resource-browser-head__identity { min-width: 0; display: flex; align-items: center; }
.resource-browser-breadcrumb { min-width: 0; display: flex; align-items: center; gap: 9px; }
.resource-browser-breadcrumb .site-return { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.25; white-space: nowrap; }
.resource-browser-breadcrumb .site-return:hover,
.resource-browser-breadcrumb .site-return:focus-visible { color: var(--resource-orange); }
.resource-browser-breadcrumb > span { flex: 0 0 auto; color: var(--resource-border); }
.resource-home-hero p:last-child,
.resource-browser-head p:last-child { max-width: 760px; margin-bottom: 0; color: var(--muted); }
.resource-browser-head__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.resource-browser-head__actions [hidden] { display: none !important; }
.resource-preview-pane__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.featured-activity { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); min-height: 560px; border: 1px solid var(--resource-border); background: var(--resource-panel); box-shadow: var(--resource-shadow); }
.activity-carousel { position: relative; min-height: 520px; overflow: hidden; background: #292723; }
.activity-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 420ms ease, visibility 0s linear 420ms; }
.activity-slide.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }
.activity-slide img { width: 100%; height: 100%; object-fit: cover; }
.activity-media-empty { min-height: 520px; display: grid; place-content: center; gap: 12px; color: #eee7dd; text-align: center; }
.activity-media-empty span,
.resource-home-empty > span,
.folder-overview > span { display: block; font-size: 4rem; color: var(--resource-orange); }
.activity-carousel__controls { position: static; inset: auto; z-index: auto; display: flex; align-items: center; gap: 8px; padding: 6px; color: #fff; background: transparent; }
.activity-carousel__controls button { min-width: 44px; min-height: 44px; padding: 8px; }
.activity-copy { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(28px, 4vw, 64px); }
.activity-copy h2 { margin: 8px 0 12px; font-size: clamp(2rem, 3vw, 3.5rem); line-height: 1.08; }
.activity-tag { margin: 0; padding: 6px 10px; border: 1px solid var(--resource-orange); color: var(--resource-orange); font-weight: 800; }
.activity-date { color: var(--muted); font-weight: 700; }
.activity-files { width: 100%; margin: 24px 0; }
.activity-files h3 { margin-bottom: 10px; }
.activity-files a { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--resource-border); color: var(--ink); text-decoration: none; }
.activity-files__icon { display: grid; width: 46px; min-width: 46px; place-items: center; color: var(--resource-orange); }
.activity-files__copy { display: grid; min-width: 0; align-content: center; gap: 2px; }
.activity-files__copy strong { display: block; min-width: 0; overflow: hidden; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.activity-files__copy small { display: block; min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.activity-archive { margin-top: auto; }
.resource-home-empty { min-height: 480px; display: grid; place-content: center; justify-items: center; padding: 42px; border: 1px solid var(--resource-border); background: #fff; text-align: center; }
.resource-home-empty h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.resource-inline-empty { color: var(--muted); }
.explore-more { margin: 70px 0 30px; padding: clamp(34px, 5vw, 70px); border-top: 1px solid var(--resource-border); text-align: center; }
.explore-more h2 { font-size: clamp(2rem, 4vw, 4rem); }

.resource-browser-main { width: min(calc(100% - 32px), 1760px) !important; max-width: 1760px !important; padding-bottom: 24px !important; }
.resource-workspace { --folder-width: clamp(180px, 15vw, 360px); --list-width: clamp(280px, 24vw, 560px); display: grid; grid-template-columns: var(--folder-width) 10px var(--list-width) 10px minmax(0, 1fr); min-height: min(800px, calc(100vh - var(--actual-header-height, 132px))); height: calc(100vh - var(--actual-header-height, 132px)); border: 1px solid var(--resource-border); background: #fff; box-shadow: var(--resource-shadow); overflow: hidden; }
.resource-folders,
.resource-files,
.resource-preview-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.resource-folders,
.resource-files { border-right: 1px solid var(--resource-border); }
.resource-resizer { position: relative; z-index: 2; cursor: col-resize; background: var(--resource-paper); touch-action: none; }
.resource-resizer::after { position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: var(--resource-border); content: ""; }
.resource-resizer:hover::after,
.resource-resizer:focus-visible::after,
.resource-resizer.is-dragging::after { left: 2px; width: 5px; background: var(--resource-orange); outline: 0; }
.resource-folders > header,
.resource-files > header,
.resource-preview-pane > header { min-height: 84px; padding: 15px 18px; border-bottom: 1px solid var(--resource-border); background: #faf8f3; }
.resource-folders > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.resource-files > header,
.resource-preview-pane > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.resource-files > header > div:first-child,
.resource-preview-pane > header > div:first-child { min-width: 0; flex: 1 1 auto; }
.resource-folders h2,
.resource-files h2,
.resource-preview-pane h2 { margin: 2px 0 0; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-current-folder { max-width: 100%; }
.resource-current-folder__marquee { min-width: 100%; display: inline-flex; gap: 32px; white-space: nowrap; will-change: transform; }
.resource-current-folder__text { flex: 0 0 auto; }
.resource-current-folder__text--repeat { display: none; }
.resource-current-folder.is-overflowing .resource-current-folder__marquee { animation: resource-current-folder-scroll var(--current-folder-marquee-duration, 7s) linear infinite; }
.resource-current-folder.is-overflowing .resource-current-folder__text--repeat { display: inline; }
.resource-current-folder.is-overflowing:hover .resource-current-folder__marquee,
.resource-current-folder.is-overflowing:focus-visible .resource-current-folder__marquee { animation-play-state: paused; }
@keyframes resource-current-folder-scroll {
  to { transform: translateX(calc(-1 * var(--current-folder-marquee-distance, 160px))); }
}
.workspace-kicker { color: var(--resource-orange); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.resource-mobile-back { display: none; }
.folder-search { display: block; padding: 8px; border-bottom: 1px solid var(--resource-border); }
.folder-search input { width: 100%; min-height: 38px; border-radius: 0; }
.resource-folders nav { min-height: 0; flex: 1; overflow: auto; padding: 10px 8px 20px; }
.folder-node { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px calc(10px + var(--depth, 0) * 18px); overflow: hidden; border: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 500; }
.folder-node span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-node small { color: var(--muted); font-size: .72rem; }
.folder-node:hover,
.folder-node:focus-visible,
.folder-node.is-selected { background: #f2ece2; color: var(--resource-orange); }
.resource-browser-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-bottom: 1px solid var(--resource-border); }
.resource-browser-filters label:first-child { grid-column: 1 / -1; }
.resource-browser-filters label span { display: block; color: var(--muted); font-size: .72rem; }
.resource-browser-filters input,
.resource-browser-filters select { min-height: 42px; border-radius: 0; }
.resource-browser-filters button { grid-column: 1 / -1; min-height: 44px; }
.resource-file-list { min-height: 0; flex: 1; overflow: auto; padding: 8px; scrollbar-gutter: stable; }
.resource-file-row { width: 100%; min-height: 104px; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 14px 12px; border: 0; border-bottom: 1px solid var(--resource-border); border-radius: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 400; }
.resource-file-row:hover,
.resource-file-row:focus-visible,
.resource-file-row.is-selected { background: #fff7f2; }
.resource-file-row.is-selected { box-shadow: inset 4px 0 var(--resource-orange); }
.resource-file-row__type { position: relative; width: 44px; height: 44px; display: grid; place-items: center; align-self: start; box-sizing: border-box; padding: 5px; border: 1px solid var(--resource-border); color: var(--resource-orange); font-size: .68rem; font-weight: 900; line-height: 1; text-align: center; text-transform: uppercase; }
.resource-file-row__type .file-icon { position: absolute; top: 50%; left: 50%; margin: 0; transform: translate(-50%, -50%); }
.resource-file-row strong,
.resource-file-row small,
.resource-file-row em { display: block; overflow: hidden; text-overflow: ellipsis; }
.resource-file-row small { margin: 4px 0; color: var(--muted); white-space: nowrap; }
.resource-file-row em { color: var(--muted); font-size: .75rem; font-style: normal; white-space: nowrap; }
.resource-file-row__title{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-width:0}.resource-file-row__title>strong{min-width:0}.resource-review-badge{display:inline-flex;flex:0 0 auto;align-items:center;gap:6px;min-height:28px;padding:3px 8px;border:1px solid #aaa;background:#f6f6f6;color:#666;font-size:.72rem;font-weight:800;line-height:1;white-space:nowrap}.resource-review-badge>span{color:#8b8b8b;font-size:.65rem}.resource-review-badge--pending{border-color:#dfb184;background:#fff8ee;color:#8c4c16}.resource-review-badge--returned,.resource-review-badge--rejected{border-color:#cfaaa5;background:#fff4f2;color:#8d332a}.resource-review-badge--taken_down{border-color:#aaa;background:#f0f0f0;color:#555}
.resource-file-group { border-bottom: 1px solid var(--resource-border); background: transparent; }
.resource-file-group__header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border: 1px solid transparent; background: transparent; box-shadow: inset 4px 0 transparent; transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
.resource-file-group__header:hover,
.resource-file-group__header:focus-within,
.resource-file-group__header:has(.resource-file-row.is-selected) { border-color: rgba(216, 90, 42, .7); background: #fff7f2; box-shadow: inset 4px 0 var(--resource-orange); }
.resource-file-group__header:hover .resource-file-group__toggle,
.resource-file-group__header:focus-within .resource-file-group__toggle,
.resource-file-group__header:has(.resource-file-row.is-selected) .resource-file-group__toggle { border-color: var(--resource-orange); background: #fff7f2; color: var(--resource-orange); }
.resource-file-group__header .resource-file-row { min-width: 0; border-bottom: 0; }
.resource-file-group__header .resource-file-row:hover,
.resource-file-group__header .resource-file-row:focus-visible,
.resource-file-group__header .resource-file-row.is-selected { background: transparent; box-shadow: none; }
.resource-file-group__toggle { align-self: center; min-width: 58px; margin: 8px 8px 8px 0; padding: 5px 7px; border: 1px solid var(--resource-border); border-radius: 0; background: #faf8f3; color: var(--muted); font-size: .7rem; font-weight: 750; white-space: nowrap; transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 300ms cubic-bezier(.22, 1, .36, 1); }
.resource-file-group__toggle:hover, .resource-file-group__toggle:focus-visible { border-color: var(--resource-orange); background: #fff1e8; color: var(--resource-orange); }
.resource-file-group__body { display: grid; grid-template-rows: 1fr; opacity: 1; transform: translateY(0) scaleY(1); transform-origin: top center; transition: grid-template-rows 300ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease, transform 300ms cubic-bezier(.22, 1, .36, 1); }
.resource-file-group.is-collapsed .resource-file-group__body { grid-template-rows: 0fr; opacity: 0; transform: translateY(-7px) scaleY(.96); pointer-events: none; }
.resource-file-group__clip { min-height: 0; overflow: hidden; }
.resource-file-group__attachments { display: grid; gap: 1px; margin: 0 8px 10px 78px; padding: 6px 0; border-left: 2px solid #ead9ca; background: #fbfaf7; }
.resource-attachment-row { width: 100%; min-height: 30px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 4px 8px; border: 0; border-radius: 0; background: transparent; color: var(--muted); text-align: left; font-size: .74rem; font-weight: 550; opacity: 1; transform: translateY(0); transition: background 180ms ease, color 180ms ease, padding-left 220ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease calc(var(--attachment-index, 0) * 42ms), transform 300ms cubic-bezier(.22, 1, .36, 1) calc(var(--attachment-index, 0) * 42ms); }
.resource-file-group.is-collapsed .resource-attachment-row { opacity: 0; transform: translateY(-7px) scaleY(.96); }
.resource-attachment-row:hover, .resource-attachment-row:focus-visible { padding-left: 13px; background: #fff1e8; color: var(--ink); }
.resource-attachment-row.is-selected { background: #fff1e8; color: var(--resource-orange); }
.resource-attachment-row .file-icon { width: 18px; height: 18px; }
.resource-attachment-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-attachment-row small { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.resource-pagination { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--resource-border); font-size: .82rem; }
.resource-pagination button { min-height: 42px; padding: 8px 10px; }
.resource-preview-pane > header > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.resource-preview-pane > header button { min-height: 40px; padding: 7px 10px; }
.resource-preview-pane [hidden] { display: none !important; }
.resource-preview-body { min-height: 0; flex: 1; overflow: auto; background: #eee9df; }
.folder-overview { --folder-overview-mark-side: 36px; min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 40px; text-align: center; }
.folder-overview__logo { width: calc(var(--folder-overview-mark-side) * 3); height: calc(var(--folder-overview-mark-side) * 3); display: block; object-fit: contain; }
.folder-overview h3 { margin: 0; color: var(--resource-orange); }
.folder-overview ul { max-width: 560px; margin: 16px auto 0; padding: 0; list-style: none; color: var(--muted); }
.folder-overview li { padding: 5px 0; }
.resource-preview-frame { width: 100%; height: 100%; min-height: 0; display: block; border: 0; background: #fff; }
.resource-preview-details { display: flex; min-height: 0; height: 100%; flex-direction: column; }
.resource-preview-details__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px; border-bottom: 1px solid var(--resource-border); background: #faf8f3; color: var(--muted); font-size: .8rem; }
.resource-attachment-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--resource-border); background: #fff; }
.resource-attachment-tabs button { flex: 0 0 auto; min-height: 40px; border: 1px solid var(--resource-border); border-radius: 0; background: #fff; color: var(--ink); }
.resource-attachment-tabs button.is-selected { border-color: var(--resource-orange); background: #fff1e8; box-shadow: inset 3px 0 var(--resource-orange); font-weight: 800; }
.resource-attachment-tabs button:not(:disabled):hover,
.resource-attachment-tabs button:not(:disabled):focus-visible,
.preview-attachment-gallery__tabs button:not(:disabled):hover,
.preview-attachment-gallery__tabs button:not(:disabled):focus-visible {
  border-color: var(--resource-orange);
  background: #f3ede2;
  color: #a63c1c;
  box-shadow: inset 3px 0 var(--resource-orange);
}
.resource-attachment-tabs button.is-selected:hover,
.resource-attachment-tabs button.is-selected:focus-visible,
.preview-attachment-gallery__tabs button.is-selected:hover,
.preview-attachment-gallery__tabs button.is-selected:focus-visible { background: #f3ede2; color: #a63c1c; }
.resource-attachment-tabs button:disabled { opacity: .55; }
.resource-preview-navigation { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--resource-border); background: #faf8f3; }
.resource-preview-navigation button { min-width: 72px; min-height: 34px; padding: 5px 10px; border-radius: 0; }
.resource-preview-navigation__position { min-width: 5rem; color: var(--muted); font-size: .8rem; text-align: center; }
.resource-preview-stage { display: flex; min-width: 0; min-height: 0; flex: 1; align-items: center; justify-content: center; overflow: auto; background: #eee9df; outline: none; overscroll-behavior: contain; touch-action: pan-y; }
.resource-preview-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--resource-orange); }
.resource-preview-media { display: block; width: 100%; max-width: 100%; max-height: 100%; border: 0; object-fit: contain; }
.resource-preview-media--image { width: auto; height: auto; min-width: 0; min-height: 0; }
.resource-list-state { display: grid; place-content: center; min-height: 220px; padding: 30px; text-align: center; color: var(--muted); }

.embedded-preview-body { min-height: 100vh; overflow: hidden; background: #e8e2d7; }
.embedded-preview { width: 100%; height: 100vh; display: flex; flex-direction: column; overflow: auto; padding: 0; }
.embedded-preview__notice { margin: 0; padding: 10px 14px; background: #fff4d9; color: #6f5313; font-size: .82rem; }
.embedded-preview__frame { width: 100%; min-height: 100vh; flex: 1; border: 0; background: #fff; }
.embedded-preview__media { width: 100%; max-width: 100%; max-height: 100vh; margin: auto; object-fit: contain; background: #171717; }
.embedded-preview__image { height: auto; min-height: 0; background: transparent; }
.embedded-preview__stage { min-height: 0; flex: 1; margin: 0; overflow: auto; }
.preview-attachment-gallery { display: flex; min-height: 0; flex-direction: column; border: 1px solid var(--resource-border); background: #fff; }
.preview-attachment-gallery__header,
.preview-attachment-gallery__controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--resource-border); background: #faf8f3; color: var(--muted); }
.preview-attachment-gallery__controls { justify-content: center; }
.preview-attachment-gallery__controls button { min-width: 78px; min-height: 34px; padding: 5px 10px; border-radius: 0; }
.preview-attachment-gallery__tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--resource-border); }
.preview-attachment-gallery__tabs button { flex: 0 0 auto; min-height: 34px; max-width: 260px; overflow: hidden; padding: 5px 10px; border: 1px solid var(--resource-border); border-radius: 0; background: #fff; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.preview-attachment-gallery__tabs button.is-selected { border-color: var(--resource-orange); background: #fff1e8; box-shadow: inset 3px 0 var(--resource-orange); font-weight: 800; }
.preview-attachment-gallery__stage { display: flex; min-height: 520px; align-items: center; justify-content: center; overflow: auto; background: #eee9df; outline: none; overscroll-behavior: contain; touch-action: pan-y; }
.preview-attachment-gallery__stage:focus-visible { box-shadow: inset 0 0 0 2px var(--resource-orange); }
.preview-attachment-gallery__image { display: block; width: auto; max-width: 100%; max-height: 70vh; object-fit: contain; }

.resource-transition { position: fixed; inset: 0; z-index: var(--z-modal, 2100); pointer-events: none; overflow: hidden; }
.resource-transition:not([hidden]) { display: block; pointer-events: auto; }
.resource-transition__orange,
.resource-transition__paper { position: absolute; inset: 0; transform: translateX(-105%); }
.resource-transition__orange { background: var(--resource-orange); transition: transform 480ms cubic-bezier(.76, 0, .24, 1); }
.resource-transition__paper { background: var(--resource-paper); transition: transform 480ms cubic-bezier(.76, 0, .24, 1) 90ms; }
.resource-transition__message { position: absolute; inset: 0; display: grid; place-content: center; margin: 0; padding: 30px; opacity: 0; color: var(--ink); font-size: clamp(1.8rem, 5vw, 5rem); font-weight: 900; text-align: center; transition: opacity 180ms ease 300ms; }
.resource-transition.is-covered .resource-transition__orange,
.resource-transition.is-covered .resource-transition__paper { transform: translateX(0); }
.resource-transition.is-covered .resource-transition__message { opacity: 1; }
.resource-transition.is-revealing .resource-transition__orange,
.resource-transition.is-revealing .resource-transition__paper { transform: translateX(105%); }
.resource-transition.is-revealing .resource-transition__message { opacity: 0; transition-delay: 0s; }
.resource-transition.is-arrival .resource-transition__message { display: none; }
body.resource-transition-busy { overflow: hidden; }

/* v0.7.5: keep the complete resource home composition inside a desktop
   viewport.  Height, spacing and media scale together; mobile/tablet rules
   remain on their existing scrolling layout. */
@media (min-width: 901px) {
  html:has(body.resource-center-page) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.resource-center-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.resource-center-page > .site-header { flex: 0 0 auto; }

  body.resource-center-page main.resource-home-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding-top: clamp(6px, 1.4dvh, 14px) !important;
    padding-bottom: clamp(8px, 1.6dvh, 16px) !important;
    overflow: hidden;
  }

  .resource-home-main .site-return {
    flex: 0 0 auto;
    margin-bottom: clamp(2px, .7dvh, 7px);
    font-size: clamp(.72rem, 1.55dvh, .9rem);
    line-height: 1.35;
  }

  .resource-home-hero {
    flex: 0 0 auto;
    gap: 10px;
    margin: 0 0 clamp(6px, 1.2dvh, 12px);
  }
  .resource-home-hero .eyebrow { margin: 0; font-size: clamp(.68rem, 1.45dvh, .88rem); }
  .resource-home-hero p:last-child { margin-top: clamp(2px, .7dvh, 8px); font-size: clamp(.75rem, 1.65dvh, .98rem); }
  .resource-home-hero .button { min-height: 34px; padding: 6px 12px; }

  .featured-activity {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }
  .activity-carousel,
  .activity-media-empty { height: 100%; min-height: 0; }
  .activity-copy {
    min-height: 0;
    padding: clamp(12px, 2.7dvh, 30px);
  }
  .activity-copy h2 {
    margin: clamp(3px, .7dvh, 8px) 0;
    font-size: clamp(1.35rem, 3.5dvh, 2.65rem);
  }
  .activity-copy > p { margin-block: clamp(2px, .65dvh, 8px); }
  .activity-tag { padding: 3px 8px; font-size: clamp(.68rem, 1.45dvh, .86rem); }
  .activity-date { font-size: clamp(.72rem, 1.55dvh, .9rem); }
  .activity-files {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(10px, 1.5vw, 22px);
    margin: clamp(5px, 1.4dvh, 15px) 0;
  }
  .activity-files h3,
  .activity-files > .resource-inline-empty { grid-column: 1 / -1; }
  .activity-files h3 { margin-bottom: clamp(2px, .6dvh, 7px); font-size: clamp(.88rem, 1.9dvh, 1.08rem); }
  .activity-files a { grid-template-columns: clamp(42px, 5dvh, 58px) minmax(0, 1fr); padding: clamp(3px, .8dvh, 8px) 0; }
  .activity-files .file-icon--large { width: clamp(24px, 3.8dvh, 38px); height: clamp(24px, 3.8dvh, 38px); }
  .activity-files strong { font-size: clamp(.76rem, 1.65dvh, .96rem); }
  .activity-files small,
  .activity-files__icon { width: 42px; min-width: 42px; }
  .activity-explore { min-height: 34px; padding: 6px 12px; font-size: clamp(.75rem, 1.55dvh, .9rem); }
  .resource-home-empty { flex: 1 1 auto; min-height: 0; padding: clamp(18px, 4dvh, 42px); }
}

.resource-home-admin .panel { border-radius: 0; }
.resource-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.resource-config-grid label { display: grid; gap: 6px; }
.resource-config-grid input,
.resource-config-grid select,
.resource-config-grid textarea { border-radius: 0; }
.resource-config-grid .config-enable,
.resource-config-grid .config-description { grid-column: 1 / -1; }
.config-enable { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.config-enable input { width: auto; }
.configuration-warning { margin: 20px 0; padding: 18px; border: 1px solid #cf6d4e; background: #fff1eb; }
.resource-selection-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 28px; }
.resource-selection-grid > section { min-width: 0; padding: 16px; border: 1px solid var(--resource-border); }
.selection-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.selection-head input { max-width: 260px; border-radius: 0; }
.candidate-list,
.ordered-selection { display: grid; gap: 8px; max-height: 480px; overflow: auto; }
.candidate-item,
.ordered-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--resource-border); }
.candidate-item small,
.ordered-item small { display: block; color: var(--muted); }
.candidate-actions,
.ordered-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.candidate-actions button,
.ordered-actions button { min-height: 40px; padding: 7px 10px; }
.ordered-item.is-invalid { border-color: #b84b32; background: #fff1eb; }
.config-save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px -22px -22px; padding: 14px 22px; border-top: 1px solid var(--resource-border); background: rgba(255, 255, 255, .96); }

@media (max-width: 900px) {
  .featured-activity { grid-template-columns: 1fr; }
  .activity-carousel,
  .activity-media-empty { min-height: 430px; }
  .resource-workspace { grid-template-columns: minmax(180px, .8fr) 10px minmax(280px, 1.2fr); grid-template-rows: minmax(520px, 64vh) minmax(620px, auto); height: auto; }
  .resource-resizer[data-resizer="middle"] { display: none; }
  .resource-preview-pane { grid-column: 1 / -1; border-top: 1px solid var(--resource-border); }
  .resource-preview-frame { min-height: 720px; }
  .resource-selection-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .resource-home-main,
  .resource-browser-main { width: auto !important; margin-inline: 14px !important; }
  .resource-home-hero,
  .resource-browser-head { align-items: flex-start; flex-direction: column; }
  .resource-browser-head__actions { justify-content: flex-start; }
  .activity-carousel,
  .activity-media-empty { min-height: 300px; }
  .activity-copy { padding: 24px 20px; }
  .resource-workspace { display: flex; flex-direction: column; min-height: 0; overflow: visible; }
  .resource-resizer { display: none; }
  .resource-mobile-back { display: inline-flex; }
  .resource-workspace[data-mobile-view="categories"] .resource-files,
  .resource-workspace[data-mobile-view="categories"] .resource-preview-pane,
  .resource-workspace[data-mobile-view="list"] .resource-folders,
  .resource-workspace[data-mobile-view="list"] .resource-preview-pane,
  .resource-workspace[data-mobile-view="preview"] .resource-folders,
  .resource-workspace[data-mobile-view="preview"] .resource-files { display: none; }
  .resource-folders,
  .resource-files { border-right: 0; border-bottom: 1px solid var(--resource-border); }
  .resource-folders nav { max-height: 260px; }
  .resource-file-list { max-height: 520px; }
  .resource-preview-body { min-height: 560px; }
  .resource-preview-frame { min-height: 620px; }
  .resource-pagination { flex-wrap: wrap; justify-content: center; }
  .resource-config-grid { grid-template-columns: 1fr; }
  .resource-config-grid .config-enable,
  .resource-config-grid .config-description { grid-column: auto; }
  .selection-head,
  .config-save-bar { align-items: stretch; flex-direction: column; }
  .config-save-bar { position: static; margin-inline: -22px; }
}

@media (prefers-reduced-motion: reduce) {
  .activity-slide,
  .resource-workspace,
  .resource-transition__orange,
  .resource-transition__paper,
  .resource-transition__message { transition-duration: 1ms !important; transition-delay: 0ms !important; }
}

/* v0.5.9.5-dev: desktop resource browser density and Windows system glyphs. */
.folder-node__icon {
  font-family: "Segoe UI Emoji", "Segoe Fluent Icons", system-ui, sans-serif;
  line-height: 1;
}
.resource-file-row__type,
.resource-attachment-tabs__icon { line-height: 1; }
.resource-transition__message { color: var(--resource-orange); text-shadow: 0 1px 0 #fff8; }
.activity-files { margin-bottom: 14px; }
.activity-explore { margin-top: auto; }

@media (min-width: 901px) {
  body.resource-browser-page { overflow: hidden; }
  body.resource-browser-page main.resource-browser-main {
    display: flex;
    flex-direction: column;
    width: min(calc(100% - 32px), 1760px) !important;
    height: calc(100dvh - var(--site-header-height));
    min-height: 0;
    padding: 4px 0 0 !important;
    overflow: hidden;
  }
  body.resource-browser-page footer { display: none; }
  .resource-browser-head { min-height: 38px; flex: 0 0 auto; gap: 10px; margin: 0 0 4px; }
  .resource-browser-head .eyebrow { display: none; }
  .resource-browser-head h1 { font-size: 1.35rem; }
  .resource-browser-head__actions { gap: 5px; }
  .resource-browser-head__actions .button { min-height: 30px; padding: 5px 8px; font-size: .78rem; }
  .resource-workspace {
    grid-template-columns: var(--folder-width) 8px var(--list-width) 8px minmax(0, 1fr);
    min-height: 0;
    height: auto;
    flex: 1;
  }
  .resource-folders > header,
  .resource-files > header,
  .resource-preview-pane > header { min-height: 48px; padding: 7px 10px; }
  .resource-folders h2,
  .resource-files h2,
  .resource-preview-pane h2 { margin: 0; font-size: 1rem; line-height: 1.25; }
  .workspace-kicker { font-size: .64rem; }
  .folder-search { padding: 5px 6px; }
  .folder-search input { min-height: 30px; padding: 5px 7px; }
  .resource-folders nav { padding: 3px 4px 6px; }
  .folder-node {
    min-height: 32px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 5px;
    padding: 3px 5px 3px calc(5px + var(--depth, 0) * 12px);
    line-height: 1.2;
  }
  .folder-node__icon { font-size: .9rem; }
  .folder-node__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .resource-browser-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px;
    gap: 5px;
    padding: 7px;
  }
  .resource-browser-filters label { min-width: 0; }
  .resource-browser-filters label span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .resource-browser-filters input,
  .resource-browser-filters select { min-height: 32px; padding: 5px 7px; }
  .resource-browser-filters button { min-height: 32px; padding: 5px; }
  .resource-file-list { padding: 4px 6px; }
  .resource-file-row { min-height: 78px; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 8px 7px; }
  .resource-file-row__type { width: 32px; height: 32px; display: grid; place-items: center; padding: 3px; font-size: 1rem; }
  .resource-file-row strong { line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; }
  .resource-file-row small { margin: 2px 0; }
  .resource-file-row em { font-size: .72rem; }
  .resource-pagination { min-height: 42px; gap: 5px; padding: 5px 7px; font-size: .75rem; }
  .resource-pagination > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .resource-pagination button { min-height: 30px; padding: 5px 7px; }
  .resource-preview-pane > header .workspace-kicker { display: none; }
  .resource-preview-pane > header button { min-height: 30px; padding: 5px 7px; font-size: .78rem; }
  .resource-preview-details__meta { min-height: 26px; display: block; overflow: hidden; padding: 4px 8px; font-size: .72rem; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
  .resource-attachment-tabs { gap: 4px; padding: 4px 8px; }
  .resource-attachment-tabs button { min-width: 0; display: inline-flex; align-items: center; gap: 5px; flex: 0 1 220px; min-height: 30px; padding: 4px 6px; overflow: hidden; }
  .resource-attachment-tabs__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .folder-overview { padding: 18px; }
  .embedded-preview { overflow: hidden; }
  .embedded-preview__frame { min-height: 0; height: 100%; }
  .embedded-preview__media { max-height: 100%; }
  .embedded-preview__stage { height: auto !important; padding: 4px !important; }
  .embedded-preview .guest-document-preview__controls {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px;
    padding: 4px;
    border-width: 0 0 1px;
    box-shadow: none;
    backdrop-filter: none;
  }
  .embedded-preview .guest-document-preview__controls .button,
  .embedded-preview .guest-document-preview__controls button { min-height: 30px; padding: 5px 7px; font-size: .78rem; }
  .embedded-preview .guest-document-preview__jump { min-width: 0; gap: 4px; }
  .embedded-preview .guest-document-preview__jump input { width: 3.25rem; min-height: 30px; padding: 4px; }
}

/* v0.5.9.8-server-pilot: denser folders and a media-first home carousel. */
@media (min-width: 901px) {
  .resource-folders nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1px;
    padding: 2px 4px 4px;
  }
  .folder-node {
    min-height: 22px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.1;
  }
}

.activity-carousel__footer {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 16px;
  left: 18px;
  top: auto;
  box-sizing: border-box;
  display: flex;
  max-height: 15%;
  min-height: 0;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  overflow: hidden;
  color: #fff;
  background: transparent;
  border: 0;
}
.activity-carousel__title {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font-size: clamp(.75rem, 1.5vw, .95rem);
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-carousel__controls {
  position: static;
  inset: auto;
  z-index: auto;
  width: min(320px, 48%);
  height: auto;
  max-height: none;
  min-width: 164px;
  top: auto;
  display: grid;
  flex: 0 1 auto;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 4px 6px;
  align-items: center;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}
.activity-carousel__controls button { min-width: 0; min-height: 26px; padding: 0; }
.activity-carousel__arrow,
.activity-carousel__dot,
.activity-carousel__progress { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .72)); }
.activity-carousel__arrow { background: transparent !important; color: #fff !important; font-size: 1.15rem; }
.activity-carousel__arrow:hover,
.activity-carousel__arrow:focus-visible { background: rgba(255, 255, 255, .18) !important; outline: 2px solid #fff; outline-offset: -2px; }
.activity-carousel__dots { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 8px; }
.activity-carousel__dot { width: 28px; position: relative; background: transparent !important; }
.activity-carousel__dot .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.activity-carousel__dot::before { width: 7px; height: 7px; display: block; margin: auto; border-radius: 999px; background: rgba(255, 255, 255, .56); content: ""; transition: width 220ms ease, background-color 220ms ease; }
.activity-carousel__dot.is-active::before { width: 20px; background: #fff; }
.activity-carousel__dot:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.activity-carousel__progress { grid-column: 1 / -1; display: block; height: 2px; overflow: hidden; background: rgba(255, 255, 255, .28); }
.activity-carousel__progress > span { display: block; width: 100%; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.activity-carousel__controls.is-autoplaying .activity-carousel__progress > span { animation: activity-carousel-progress 3s linear both; }
@keyframes activity-carousel-progress { to { transform: scaleX(1); } }

@media (max-width: 640px) {
  .activity-carousel__footer { right: 12px; bottom: 12px; left: 12px; max-height: 24%; display: grid; gap: 3px; padding: 5px 6px; }
  .activity-carousel__title { font-size: .78rem; }
  .activity-carousel__controls { width: 100%; min-width: 0; }
  .activity-carousel__dots { gap: 4px; }
  .resource-transition__message {
    font-size: 0;
    line-height: 1.25;
    white-space: pre;
  }
  .resource-transition__message::before {
    content: "火柴公益\A硕果累累";
    font-size: clamp(1.8rem, 10vw, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-carousel__dot::before,
  .activity-carousel__controls.is-autoplaying .activity-carousel__progress > span { animation: none; transition-duration: 1ms; }
}

/* v0.6.5-server-pilot: resource browser follows the supplied three-panel
   reference while retaining the existing API, preview and responsive states. */
body.resource-browser-page { overflow: hidden; }
.resource-browser-main {
  width: min(calc(100% - 32px), 1760px) !important;
  max-width: 1760px !important;
  padding-top: 0 !important;
  padding-bottom: 16px !important;
}
.resource-browser-head {
  min-height: 50px;
  margin: 0;
  align-items: center;
}
.resource-browser-head h1 { font-size: 1.25rem; font-weight: 650; color: var(--ink); }
.resource-browser-head__actions { gap: 8px; }
.resource-browser-head__actions .button { min-height: 34px; padding: 6px 14px; border-radius: 0; font-size: .82rem; }
.resource-workspace {
  --folder-width: 240px;
  --list-width: 320px;
  height: calc(100dvh - var(--site-header-height) - 66px);
  min-height: 360px;
  border-color: #e5e3dc;
  box-shadow: none;
}
.resource-folders > header,
.resource-files > header,
.resource-preview-pane > header {
  position: static;
  min-height: 50px;
  padding: 10px 16px;
  background: #faf9f6;
}
.resource-folders > header { align-items: center; }
.resource-folders h2,
.resource-files h2,
.resource-preview-pane h2 { font-size: .95rem; font-weight: 650; }
.workspace-kicker { color: #8c8c8c; font-size: .72rem; font-weight: 500; letter-spacing: 0; }
.folder-search { padding: 12px 12px 4px; border-bottom: 0; }
.folder-search input { min-height: 34px; padding: 7px 10px; font-size: .8rem; }
.resource-folders nav { padding: 0 12px 18px; }
.folder-node {
  min-height: 34px;
  padding: 6px 8px calc(6px) calc(8px + var(--depth, 0) * 18px);
  font-size: .82rem;
  font-weight: 450;
}
.folder-node:hover,
.folder-node:focus-visible,
.folder-node.is-selected { background: #fceee8; color: var(--resource-orange); }
.folder-node__icon { color: #d4a13b; }
.folder-node.is-selected .folder-node__icon { color: var(--resource-orange); }
.resource-resizer { background: #f7f6f2; }
.resource-resizer::after {
  top: 50%;
  bottom: auto;
  left: 4px;
  width: 2px;
  height: 24px;
  transform: translateY(-50%);
}
.resource-resizer:hover::after,
.resource-resizer:focus-visible::after,
.resource-resizer.is-dragging::after {
  top: 0;
  bottom: 0;
  left: 3px;
  width: 3px;
  height: auto;
  transform: none;
}
.resource-browser-filters {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 0;
}
.resource-browser-filters label:first-child { grid-column: 1 / -1; }
.resource-browser-filters input,
.resource-browser-filters select { min-height: 34px; padding: 6px 8px; font-size: .8rem; }
.resource-browser-filters button { min-height: 34px; padding: 6px 12px; font-size: .8rem; }
.resource-file-list { padding: 0 12px 12px; }
.resource-file-row { min-height: 82px; padding: 12px 8px; font-size: .82rem; }
.resource-file-row__type { padding: 5px; }
.resource-pagination { min-height: 42px; padding: 6px 12px; font-size: .76rem; }
.resource-pagination button { min-height: 28px; padding: 3px 8px; font-size: .72rem; }
.resource-preview-body { background: #fff; }
.folder-overview { padding: 30px; }
.folder-overview > span { font-size: 2.25rem; }
.folder-overview h3 { font-size: 1rem; font-weight: 600; }

@media (max-width: 768px) {
  body.resource-browser-page { overflow: auto; }
  .resource-browser-main { width: auto !important; margin-inline: 16px !important; }
  .resource-browser-head { align-items: flex-start; flex-direction: column; padding-block: 8px; }
  .resource-browser-head__actions { justify-content: flex-start; }
  .resource-workspace {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .resource-resizer { display: none; }
  .resource-folders,
  .resource-files,
  .resource-preview-pane,
  .resource-workspace[data-mobile-view="categories"] .resource-files,
  .resource-workspace[data-mobile-view="categories"] .resource-preview-pane,
  .resource-workspace[data-mobile-view="list"] .resource-folders,
  .resource-workspace[data-mobile-view="list"] .resource-preview-pane,
  .resource-workspace[data-mobile-view="preview"] .resource-folders,
  .resource-workspace[data-mobile-view="preview"] .resource-files {
    display: flex;
    width: 100%;
    min-width: 100%;
    flex: none;
  }
  .resource-folders,
  .resource-files { border-right: 0; border-bottom: 1px solid var(--resource-border); }
  .resource-folders { min-height: 300px; }
  .resource-files { min-height: 360px; }
  .resource-preview-pane { min-height: 350px; }
  .resource-mobile-back { display: none; }
  .resource-folders nav { max-height: 360px; }
  .resource-file-list { max-height: none; }
  .resource-preview-body { min-height: 300px; }
}

/* v0.6.5-server-pilot: closed desktop viewport, explicit divider rails,
   and reference-style resizer hover transition. */
@media (min-width: 769px) {
  html:has(body.resource-browser-page) {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.resource-browser-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.resource-browser-page > .site-header {
    flex: 0 0 auto;
  }

  body.resource-browser-page main.resource-browser-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding-top: 0 !important;
    padding-bottom: 16px !important;
    overscroll-behavior: none;
  }

  .resource-browser-head {
    flex: 0 0 50px;
    min-height: 50px;
    margin: 0;
  }

  .resource-workspace {
    grid-template-columns: var(--folder-width) 12px var(--list-width) 12px minmax(0, 1fr);
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    border: 1px solid #c9c2b8;
    box-shadow: 0 0 0 1px rgba(82, 73, 62, .08);
    overscroll-behavior: none;
  }

  .resource-folders,
  .resource-files { border-right: 0; }

  .resource-folders > header { justify-content: flex-start; }

  .resource-resizer {
    border-inline: 1px solid #625c54;
    background: #f7f6f2;
  }

  .resource-resizer::after {
    top: 50%;
    bottom: auto;
    left: 50%;
    width: 2px;
    height: 24px;
    transform: translate(-50%, -50%);
    background: #c5c0b8;
    transition: top .24s cubic-bezier(.22, 1, .36, 1),
      bottom .24s cubic-bezier(.22, 1, .36, 1),
      width .24s cubic-bezier(.22, 1, .36, 1),
      height .24s cubic-bezier(.22, 1, .36, 1),
      background-color .24s ease,
      transform .24s cubic-bezier(.22, 1, .36, 1);
  }

  .resource-resizer:hover::after,
  .resource-resizer:focus-visible::after,
  .resource-resizer.is-dragging::after,
  body.is-resource-resizing .resource-resizer:hover::after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    height: auto;
    transform: translateX(-50%);
    background: var(--resource-orange);
  }

  .resource-pagination {
    background: #f7f5f0;
    border-top-color: #c9c2b8;
  }

  .resource-pagination button,
  .resource-pagination button.secondary {
    border: 1px solid #b8b2aa;
    border-radius: 0;
    background: #fff;
    color: #4f4a44;
    font-weight: 500;
  }

  .resource-pagination button:not(:disabled):hover,
  .resource-pagination button:not(:disabled):focus-visible {
    border-color: var(--resource-orange);
    background: #fffaf5;
    color: var(--resource-orange);
  }
}

@media (max-width: 768px) {
  body.resource-browser-page { overflow: auto; }
  body.resource-browser-page main.resource-browser-main {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding-bottom: 24px !important;
  }
  .resource-browser-head { min-height: 0; }
  .resource-workspace { height: auto; min-height: 0; }
  .resource-folders,
  .resource-files { border-right: 0; }
  .resource-resizer { border-inline: 0; }
}

@media (max-width: 640px) {
  .resource-file-group__toggle { min-width: 52px; margin: 6px 5px 6px 0; padding-inline: 5px; }
  .resource-file-group__attachments { margin-left: 50px; }
  .resource-attachment-row { grid-template-columns: 20px minmax(0, 1fr); }
  .resource-attachment-row small { display: none; }
}

/* v0.7.4.1: keep the folder label and count in separate, shrinkable tracks on
   phones.  The previous flex fallback let a long name push the count under
   the label or outside the pane. */
@media (max-width: 768px) {
  .resource-workspace .resource-folders nav {
    min-width: 0;
    overflow-x: hidden;
  }

  .resource-workspace .folder-node {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) max-content;
    align-items: center;
    justify-content: initial;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .resource-workspace .folder-node__icon {
    width: 18px;
    min-width: 0;
    overflow: visible;
    text-align: center;
  }

  .resource-workspace .folder-node__label {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-workspace .folder-node small {
    min-width: 2ch;
    max-width: 5ch;
    overflow: hidden;
    line-height: 1.1;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-workspace .category-application {
    grid-template-columns: minmax(0, 1fr) max-content;
    min-width: 0;
    overflow: hidden;
  }

  .resource-workspace .category-application__name,
  .resource-workspace .category-application small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .resource-workspace .folder-node {
    grid-template-columns: 16px minmax(0, 1fr) max-content;
    gap: 4px;
    padding-right: 4px;
  }

  .resource-workspace .folder-node__icon { width: 16px; }
  .resource-workspace .folder-node small { max-width: 4ch; }
}

@media (prefers-reduced-motion: reduce) {
  .resource-resizer::after,
  .resource-file-group__toggle,
  .resource-file-group__body,
  .resource-attachment-row { transition-duration: 1ms !important; transition-delay: 0s !important; }
  .resource-current-folder.is-overflowing .resource-current-folder__marquee { display: block; overflow: hidden; animation: none; text-overflow: ellipsis; }
  .resource-current-folder.is-overflowing .resource-current-folder__text--repeat { display: none; }
}

/* v0.7.1: unplaced category staging and full inter-frame drag surface. */
.resource-folders {
  --draft-control-height: 42px;
  --draft-action-width: 60px;
}
.category-staging-zone {
  flex: 0 0 auto;
  margin: 4px 8px 8px;
  padding: 9px;
  border: 1px dashed #c96a45;
  background: #fffaf6;
}
.category-staging-zone[hidden] { display: none !important; }
.category-staging-zone[data-category-drag-surface] { cursor: grab; touch-action: none; }
.category-staging-zone[data-category-drag-surface]:active { cursor: grabbing; }
.category-staging-zone.is-dragging { opacity: .52; }
.category-staging-zone[data-category-drag-surface],
.category-draft[data-category-drag-surface] { user-select: none; -webkit-user-select: none; }
.category-staging-zone > header {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-bottom: 7px;
  padding: 0;
  border: 0;
  background: transparent;
}
.category-staging-zone > header strong {
  min-width: 0;
  font-size: .78rem;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: keep-all;
}
.category-staging-zone > header span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid #d8d2ca;
  background: #fff;
  color: #655f57;
  font-size: .68rem;
  white-space: nowrap;
}
.category-staging-zone__hint {
  margin: 0 1px 7px;
  color: #756c62;
  font-size: .67rem;
  line-height: 1.4;
}
.category-draft {
  margin: 3px 4px 4px calc(4px + var(--draft-depth, 0) * 12px);
  padding: 6px;
  border: 2px dashed #c96a45;
  background: #fff;
  cursor: grab;
  touch-action: none;
}
.category-draft:active { cursor: grabbing; }
.category-draft.is-dragging { opacity: .42; }
.category-draft input,
.category-draft button { cursor: auto; touch-action: auto; user-select: auto; -webkit-user-select: auto; }
.category-draft input { cursor: text; touch-action: auto; user-select: text; -webkit-user-select: text; }
.category-draft__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--draft-action-width);
  gap: 6px;
}
.category-draft__input,
.category-draft__submit {
  height: var(--draft-control-height);
  min-height: var(--draft-control-height);
  border-radius: 0;
}
.category-draft__input {
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #cfc8bf;
  font-size: .82rem;
}
.category-draft__input:focus {
  border-color: var(--resource-orange);
  outline: 2px solid rgba(202, 84, 45, .18);
  outline-offset: 0;
}
.category-draft__submit {
  width: var(--draft-action-width);
  min-width: var(--draft-action-width);
  padding: 5px 4px;
  border: 1px solid #c96a45;
  background: #c96a45;
  color: #fff;
  font-weight: 750;
}
.category-draft__submit:disabled { cursor: wait; opacity: .7; }
.category-draft__error {
  margin: 6px 1px 0;
  color: #a33627;
  font-size: .72rem;
  line-height: 1.35;
}
.resource-folders.is-category-dragging .folder-node {
  outline: 1px dashed #d8b39f;
  outline-offset: -3px;
}
.folder-node.is-category-drop-target {
  border-color: var(--resource-orange);
  background: #fce5da;
  color: var(--resource-orange);
}
.category-application {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 2px 6px;
  margin-left: 0;
  padding: 7px 8px;
  border-left: 2px solid #d7a33f;
  background: #fff9e9;
  color: #5f594f;
  font-size: .76rem;
}
.category-application__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-application small {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: #867d70;
  font-size: .64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-node__label {
  min-width: 0;
  display: block;
  overflow: hidden;
}
.category-name-marquee {
  min-width: 100%;
  display: inline-flex;
  gap: 24px;
  white-space: nowrap;
}
.category-name-text { flex: 0 0 auto; }
.category-name-text--repeat { display: none; }
.folder-node__label.is-overflowing .category-name-marquee {
  animation: category-name-scroll var(--marquee-duration, 6s) linear infinite;
}
.folder-node__label.is-overflowing .category-name-text--repeat { display: inline; }
@keyframes category-name-scroll {
  to { transform: translateX(calc(-1 * var(--marquee-distance, 120px))); }
}
.resource-folders.is-compact > header {
  padding-inline: 10px;
}
.resource-folders.is-compact h2 { font-size: .88rem; }
.resource-folders.is-compact .workspace-kicker { font-size: .62rem; }
.resource-folders.is-compact .category-staging-zone > header {
  align-items: flex-start;
  flex-direction: column;
}
.resource-folders.is-compact .category-staging-zone > header span { align-self: flex-start; }

@media (max-width: 768px) {
  .category-staging-zone { margin-inline: 12px; }
  .category-draft { margin-left: calc(4px + var(--draft-depth, 0) * 14px); }
}

@media (max-width: 420px) {
  .resource-browser-head__actions { width: 100%; }
  .resource-browser-head__actions .button {
    min-width: calc(50% - 5px);
    flex: 1 1 calc(50% - 5px);
    justify-content: center;
  }
  .category-staging-zone > header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .folder-node__label.is-overflowing .category-name-marquee {
    animation: none;
    transform: none;
  }
  .folder-node__label.is-overflowing .category-name-text--repeat { display: none; }
}

/* v0.7.7: the resource-home title deliberately inherits the same h1 scale as
   the management overview.  The desktop composition earns back that vertical
   space from media, whitespace, and controls instead of reducing the title. */
@media (min-width: 901px) {
  body.resource-center-page main.resource-home-main {
    padding-top: clamp(4px, .8dvh, 8px) !important;
    padding-bottom: clamp(6px, 1.1dvh, 12px) !important;
  }

  .resource-home-main .site-return {
    margin-bottom: clamp(1px, .45dvh, 4px);
    line-height: 1.2;
  }

  .resource-home-hero {
    gap: 8px;
    margin-bottom: clamp(3px, .7dvh, 7px);
  }

  .resource-home-hero h1 { margin-block: 2px 6px; }
  .resource-home-hero p:last-child { margin-top: 0; }
  .resource-home-hero .button { min-height: 30px; padding: 5px 10px; }

  .activity-carousel__footer { top: auto; right: 10px; bottom: 10px; left: 10px; height: auto; max-height: 15%; padding: 5px 7px; }
  .activity-carousel__controls { position: static; inset: auto; height: auto; max-height: none; gap: 4px; padding: 0; }
  .activity-carousel__controls button { min-width: 26px; min-height: 26px; padding: 3px; }
  .activity-copy { padding: clamp(8px, 1.8dvh, 16px); }
  .activity-copy h2 { margin-block: 2px 5px; }
  .activity-files { margin: clamp(3px, .9dvh, 8px) 0; }
  .activity-files a { padding-block: clamp(2px, .55dvh, 5px); }
  .activity-explore { min-height: 30px; padding: 5px 10px; }
}

/* v0.7.7: metadata belongs to the preview header.  Both pieces of text are
   independently shrinkable so a long resource title cannot widen the pane. */
.resource-preview-pane > header > .resource-preview-pane__identity {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}
.resource-preview-pane__title-row { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
.resource-preview-pane__title-row h2 { min-width: 0; flex: 1 1 auto; }
.resource-preview-pane__meta {
  min-width: 0;
  max-width: 48%;
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resource-preview-navigation[hidden] { display: none; }

@media (max-width: 640px) {
  .resource-browser-head { align-items: flex-start; }
  .resource-browser-head__identity { width: 100%; }
  .resource-browser-breadcrumb { flex-wrap: wrap; row-gap: 2px; }
  .resource-preview-pane__title-row { gap: 5px; }
  .resource-preview-pane__meta { max-width: 45%; font-size: .66rem; }
}

/* v0.8.1: keep carousel controls inside the arrow track and scale the public
   archive density from the actual number of selected files. */
.activity-carousel__footer { min-width: 0; }
.activity-carousel__title { max-width: 100%; }
.activity-carousel__controls {
  min-width: 170px;
  max-width: min(320px, 58%);
  flex: 0 1 320px;
  overflow: hidden;
}
.activity-carousel__arrow { flex: 0 0 26px; }
.activity-carousel__dots {
  min-width: 0;
  flex: 1 1 auto;
  gap: clamp(2px, .55vw, 7px);
  overflow: hidden;
}
.activity-carousel__dot { width: clamp(14px, 2vw, 22px); flex: 1 1 22px; }
.activity-carousel__dot::before { width: 6px; }
.activity-carousel__dot.is-active::before { width: min(18px, 100%); }

.activity-files { display: grid; grid-template-columns: 1fr; column-gap: clamp(10px, 1.5vw, 22px); }
.activity-files h3,
.activity-files > .resource-inline-empty { grid-column: 1 / -1; }
@media (min-width: 901px) {
  .activity-files--single { grid-template-columns: 1fr !important; }
  .activity-files--double { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

.activity-explore {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-width: 205px;
  min-height: 0;
  align-items: center;
  gap: 30px;
  margin-top: auto;
  padding: 15px 18px;
  overflow: hidden;
  border: 1px solid var(--resource-orange);
  border-radius: 0;
  background: transparent;
  color: #a83d1d;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 220ms cubic-bezier(.22,1,.36,1), transform 220ms cubic-bezier(.22,1,.36,1);
}
.activity-explore::before { position: absolute; inset: 1px; z-index: 0; background: var(--resource-orange); content: ""; transform: translateX(-101%); transition: transform 220ms cubic-bezier(.22,1,.36,1); }
.activity-explore > span,
.activity-explore > i { position: relative; z-index: 1; }
.activity-explore > i { width: 32px; height: 1px; margin-left: auto; background: currentColor; transition: transform 220ms cubic-bezier(.22,1,.36,1); }
.activity-explore > i::after { position: absolute; top: -3px; right: 0; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; content: ""; transform: rotate(45deg); }
.activity-explore:hover,
.activity-explore:focus-visible { color: #fff; transform: translateY(-2px); }
.activity-explore:hover::before,
.activity-explore:focus-visible::before { transform: translateX(0); }
.activity-explore:hover > i,
.activity-explore:focus-visible > i { transform: translateX(6px); }
@media (max-width: 640px) {
  .activity-carousel__controls { width: 100%; min-width: 0; max-width: 100%; }
  .activity-explore { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .activity-explore,
  .activity-explore::before,
  .activity-explore > i { transition-duration: 80ms; }
  .activity-explore:hover,
  .activity-explore:focus-visible,
  .activity-explore:hover > i,
  .activity-explore:focus-visible > i { transform: none; }
}

/* v0.8.5: phone-only file-manager flow. The 641px+ tablet and desktop
   workspaces keep the existing category/list/preview composition. */
.resource-mobile-toolbar,
.resource-mobile-filters { display: none; }

@media (max-width: 640px) {
  .resource-workspace {
    position: relative;
    display: block;
    min-height: 520px;
    overflow: visible;
  }
  .resource-folders,
  .resource-resizer { display: none !important; }
  .resource-files,
  .resource-preview-pane,
  .resource-workspace[data-mobile-view="list"] .resource-files,
  .resource-workspace[data-mobile-view="preview"] .resource-preview-pane {
    width: 100%;
    min-width: 0;
    border: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 160ms ease, transform 180ms cubic-bezier(.22,1,.36,1), visibility 0s linear 0s;
  }
  .resource-workspace[data-mobile-view="list"] .resource-preview-pane,
  .resource-workspace[data-mobile-view="preview"] .resource-files {
    position: absolute;
    inset: 0;
    width: 100%;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(8px);
    transition: opacity 160ms ease, transform 180ms cubic-bezier(.22,1,.36,1), visibility 0s linear 180ms;
  }
  .resource-files > header { display: none; }
  .resource-mobile-toolbar {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--resource-border);
    background: #fff;
  }
  .resource-mobile-toolbar__back {
    display: inline-grid;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--resource-border);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
  }
  .resource-mobile-toolbar__back.is-root {
    visibility: hidden;
    pointer-events: none;
  }
  .resource-mobile-toolbar__identity {
    display: grid;
    min-width: 0;
    gap: 1px;
  }
  .resource-mobile-toolbar__identity span {
    color: var(--resource-muted);
    font-size: .68rem;
    line-height: 1.2;
  }
  .resource-mobile-toolbar__identity strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: .94rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    writing-mode: horizontal-tb;
  }
  .resource-mobile-sort { position: relative; }
  .resource-mobile-sort > button {
    min-height: 36px;
    padding: 7px 10px;
    white-space: nowrap;
  }
  .resource-mobile-sort__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 12;
    display: grid;
    width: min(190px, calc(100vw - 32px));
    padding: 6px;
    border: 1px solid var(--resource-border);
    background: #fff;
    box-shadow: 0 12px 26px #2e1a1226;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: opacity 160ms ease, transform 180ms cubic-bezier(.22,1,.36,1), visibility 0s linear 0s;
  }
  .resource-mobile-sort__menu[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition-delay: 0s,0s,180ms;
  }
  .resource-mobile-sort__menu button {
    justify-content: flex-start;
    min-height: 38px;
    padding: 7px 9px;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
  }
  .resource-mobile-sort__menu button:hover,
  .resource-mobile-sort__menu button:focus-visible { background: var(--resource-paper); color: var(--resource-orange); }
  .resource-mobile-filters {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: start;
    gap: 8px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--resource-border);
    background: #fff;
  }
  .resource-mobile-filters .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .resource-mobile-filters label { min-width: 0; }
  .resource-mobile-filters input { width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; }
  .resource-mobile-filters > button { min-height: 38px; padding: 7px 12px; white-space: nowrap; }
  .resource-mobile-types {
    grid-column: 1 / -1;
    display: flex;
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .resource-mobile-types::-webkit-scrollbar { display: none; }
  .resource-mobile-types button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--resource-border);
    background: #fff;
    color: var(--resource-muted);
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  }
  .resource-mobile-types button[aria-pressed="true"] { border-color: var(--resource-orange); background: #fff1e9; color: var(--resource-orange); }
  .resource-browser-filters { display: none; }
  .resource-file-list { display: grid; max-height: none; padding: 0; }
  .resource-mobile-folder-row {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr) max-content;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 64px;
    padding: 10px 12px;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--resource-border);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
    transition: background-color 160ms ease, transform 180ms cubic-bezier(.22,1,.36,1);
  }
  .resource-mobile-folder-row:hover,
  .resource-mobile-folder-row:focus-visible { background: #fff8ee; transform: translateX(2px); }
  .resource-mobile-folder-row.is-pending { background: #fffaf0; }
  .resource-mobile-folder-row__icon { font-family: "Segoe UI Emoji",system-ui,sans-serif; font-size: 1.15rem; line-height: 1; }
  .resource-mobile-folder-row__copy { display: grid; min-width: 0; gap: 2px; }
  .resource-mobile-folder-row__copy strong,
  .resource-mobile-folder-row__copy small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .resource-mobile-folder-row__copy small { color: var(--resource-muted); font-size: .72rem; }
  .resource-file-group,
  .resource-file-row { border-bottom: 1px solid var(--resource-border); }
  .resource-file-row { min-height: 76px; padding: 10px 12px; }
  .resource-pagination { min-height: 50px; padding: 8px 12px; }
  .resource-preview-pane { min-height: 520px; background: #fff; }
  .resource-preview-pane .resource-mobile-back { display: inline-flex; }
  .resource-preview-body { min-height: 420px; }
}

@media (max-width: 380px) {
  .resource-mobile-toolbar,
  .resource-mobile-filters { padding-inline: 9px; }
  .resource-mobile-toolbar { gap: 6px; }
  .resource-mobile-sort > button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .resource-files,
  .resource-preview-pane,
  .resource-mobile-sort__menu,
  .resource-mobile-types button,
  .resource-mobile-folder-row { transition-duration: 80ms; }
}

/* v0.8.7: mobile resource browser follows the compact single-column file
   manager reference. Desktop and tablet selectors remain untouched. */
.resource-mobile-category-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(34, 29, 24, .38);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 180ms ease, visibility 0s linear 0s;
}
.resource-mobile-category-dialog[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s, 180ms;
}
.resource-mobile-category-dialog__panel {
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--resource-border);
  border-left: 5px solid var(--resource-orange);
  border-radius: 0;
  background: #fffaf5;
  box-shadow: 0 22px 54px rgba(49, 34, 23, .24);
  transform: translateY(0);
  transition: transform 200ms cubic-bezier(.22,1,.36,1);
}
.resource-mobile-category-dialog[aria-hidden="true"] .resource-mobile-category-dialog__panel { transform: translateY(12px); }
.resource-mobile-category-dialog__panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--resource-border);
}
.resource-mobile-category-dialog__panel > header span { color: var(--resource-orange); font-size: .75rem; font-weight: 800; }
.resource-mobile-category-dialog__panel > header h2 { margin: 2px 0 0; font-size: 1.35rem; }
.resource-mobile-category-dialog__panel > header button { min-height: 38px; padding: 6px 10px; }
.resource-mobile-category-dialog__panel form { display: grid; gap: 16px; padding: 18px; }
.resource-mobile-category-dialog__panel form label { display: grid; gap: 7px; font-weight: 750; }
.resource-mobile-category-dialog__panel form input { width: 100%; min-height: 46px; border-radius: 0; }
.resource-mobile-category-dialog__location { display: grid; gap: 3px; padding: 12px; border-left: 3px solid var(--resource-orange); background: #fff; }
.resource-mobile-category-dialog__location > span,
.resource-mobile-category-dialog__location > small { color: var(--resource-muted); font-size: .75rem; }
.resource-mobile-category-dialog__location > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-mobile-category-dialog__error { margin: 0; color: #9e3026; font-weight: 700; }
.resource-mobile-category-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.resource-mobile-category-dialog__actions button { min-height: 44px; }

@media (max-width: 640px) {
  body.resource-browser-page > header.site-header {
    min-height: 62px;
    padding: 0 12px;
    border-top: 2px solid var(--ink);
  }
  body.resource-browser-page > header.site-header > .brand { display: none; }
  body.resource-browser-page > header.site-header > nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    gap: 0;
    font-size: .95rem;
  }
  body.resource-browser-page > header.site-header > nav > a,
  body.resource-browser-page > header.site-header > nav > .nav-menu {
    width: 100%;
    min-width: 0;
  }
  body.resource-browser-page > header.site-header > nav > a,
  body.resource-browser-page > header.site-header .nav-menu__trigger {
    width: 100%;
    min-width: 0;
    min-height: 60px;
  }
  body.resource-browser-page main.resource-browser-main {
    margin-inline: 12px !important;
    padding-top: 6px !important;
    padding-bottom: 18px !important;
  }
  body.resource-browser-page .resource-browser-head {
    display: flex;
    min-height: 48px;
    margin: 0;
    padding: 0;
    justify-content: center;
  }
  body.resource-browser-page .resource-browser-head__identity { width: 100%; }
  body.resource-browser-page .resource-browser-breadcrumb { width: 100%; gap: 9px; }
  body.resource-browser-page .resource-browser-breadcrumb .site-return {
    min-height: 40px;
    font-size: .82rem;
  }
  body.resource-browser-page .resource-browser-breadcrumb h1 { font-size: 1.25rem; white-space: nowrap; }
  body.resource-browser-page .resource-browser-head__actions { display: none; }
  body.resource-browser-page .resource-workspace {
    min-height: calc(100dvh - 116px);
    border: 1px solid var(--resource-border);
    background: #fff;
    box-shadow: none;
  }
  body.resource-browser-page .resource-files { min-height: calc(100dvh - 116px); }
  body.resource-browser-page .resource-mobile-toolbar {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    min-height: 72px;
    padding: 10px 12px;
  }
  .resource-mobile-tools { display: flex; align-items: center; gap: 6px; }
  .resource-mobile-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 36px;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: var(--resource-orange);
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease;
  }
  .resource-mobile-tool:hover,
  .resource-mobile-tool:focus-visible { background: #fff3ea; color: #a83f1b; }
  body.resource-browser-page .resource-mobile-sort > button { min-height: 36px; padding: 6px 8px; }
  body.resource-browser-page .resource-mobile-sort__menu { top: calc(100% + 8px); }
  body.resource-browser-page .resource-mobile-filters {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 8px;
    padding: 18px 12px 16px;
  }
  body.resource-browser-page .resource-mobile-filters h2 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 1.08rem;
  }
  body.resource-browser-page .resource-mobile-filters input,
  body.resource-browser-page .resource-mobile-filters > button { min-height: 44px; }
  body.resource-browser-page .resource-mobile-types {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    overflow: visible;
  }
  body.resource-browser-page .resource-mobile-types button {
    width: auto;
    min-width: 0;
    min-height: 38px;
    padding: 5px 2px;
    font-size: .78rem;
  }
  body.resource-browser-page .resource-file-list {
    align-content: start;
    min-height: 300px;
    flex: 1 1 auto;
  }
  body.resource-browser-page .resource-mobile-folder-row {
    min-height: 74px;
    padding: 12px 14px;
  }
  body.resource-browser-page .resource-pagination {
    position: sticky;
    bottom: 0;
    z-index: 4;
    min-height: 64px;
    background: #fff;
  }
}

@media (max-width: 390px) {
  body.resource-browser-page main.resource-browser-main { margin-inline: 8px !important; }
  body.resource-browser-page .resource-mobile-toolbar,
  body.resource-browser-page .resource-mobile-filters { padding-inline: 9px; }
  .resource-mobile-tools { gap: 1px; }
  .resource-mobile-tool { min-width: 43px; padding-inline: 5px; }
  body.resource-browser-page .resource-mobile-types { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .resource-mobile-category-dialog,
  .resource-mobile-category-dialog__panel,
  .resource-mobile-tool { transition-duration: 80ms; }
}

/* v0.8.13.2.1: retain the accepted phone composition and halve only the
   return-to-title gap. */
@media (max-width: 640px) {
  body.resource-center-page main.resource-home-main { padding-top: 8px !important; padding-bottom: 18px !important; }
  .resource-home-main .site-return { margin-bottom: 4px; }
  .resource-home-hero { gap: 6px; margin: 0 0 16px; }
  .resource-home-hero .eyebrow { margin: 8px 0 0; }
  .resource-home-hero h1 { margin-block: 0 4px; }
  .resource-home-hero p:last-child { margin: 4px 0 0; }
  .featured-activity { min-height: 0; }
  .activity-carousel,
  .activity-media-empty { min-height: 240px; }
  .activity-copy { padding: 18px 14px; }
  .activity-copy h2 { margin: 8px 0; }
  .activity-copy > p { margin-block: 6px; }
  .activity-files { margin: 14px 0; }
  .activity-files h3 { margin: 0 0 8px; }
  .activity-files a { min-height: 58px; padding: 8px 0; }
  .activity-explore { margin-top: 14px; }

  body.resource-browser-page .resource-mobile-toolbar { grid-template-columns: 36px minmax(0, 1fr) auto; }
  body.resource-browser-page .resource-mobile-toolbar__identity { justify-items: start; text-align: left; }
  body.resource-browser-page .resource-mobile-toolbar__identity span,
  body.resource-browser-page .resource-mobile-toolbar__identity strong { width: 100%; text-align: left; }
  .resource-mobile-tool--icon { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 9px; }
  .resource-mobile-tool--icon svg { display: block; width: 24px; height: 24px; }
  body.resource-browser-page .resource-mobile-filters { padding-top: 10px; }
}
