/* Asset Hub: the shell (folder tree beside the page), the library and folder
   pages (head, toolbar, subfolders, the grid of cards and the list), the hub's
   top bar parts, its sheets (.hub-portal: folders, the folder picker, web
   addresses) and the pictures of its tour. Built from app.css's tokens and
   recipes; the drawer, filters, selection bar and other pages are in
   hub-detail.css. */

/* -------------------------------------------------------------------- shell */

/* --hub-drawer-w comes from the drawer (set on <html> while it shows); 480px until then. */
.hub {
  --hub-side-w: 260px;
  --hub-top: 84px;
  display: grid;
  grid-template-columns: var(--hub-side-w) minmax(0, 1fr);
  align-items: start;
  width: 100%;
  min-width: 0;
}

.hub__side {
  position: sticky;
  top: var(--hub-top);
  max-height: calc(100vh - var(--hub-top));
  max-height: calc(100dvh - var(--hub-top));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 16px 32px 0;
  scrollbar-width: thin;
}

.hub__scrim {
  display: none;
}

/* The hairline between the tree and the page runs the page's whole height. */
.hub__main {
  min-width: 0;
  min-height: calc(100vh - var(--hub-top) - 64px);
  padding-left: 32px;
  border-left: 1px solid var(--line);
  transition: padding-right 0.26s var(--ease);
}

.hub--bare {
  grid-template-columns: minmax(0, 1fr);
}

.hub--bare .hub__side {
  display: none;
}

.hub--bare .hub__main {
  padding-left: 0;
  border-left: 0;
}


/* ------------------------------------------------------------------ the tree */

.hub-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-tree__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 0 6px 12px;
}

.hub-tree__title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.hub-tree__new svg {
  width: 15px;
  height: 15px;
}

.hub-tree__list,
.hub-tree__list ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-tree__list ul {
  margin-top: 2px;
}

.hub-tree__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  padding: 0 6px 0 calc(4px + var(--depth, 0) * 16px);
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
  transition: background 0.16s, box-shadow 0.16s, opacity 0.16s;
}

.hub-tree__row:hover {
  background: var(--soft-1);
}

.hub-tree__row.is-current {
  background: var(--soft-2);
}

.hub-tree__row.is-dragging {
  opacity: 0.4;
}

.hub-tree__row.is-drop {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--blue);
}

.hub-tree__all,
.hub-tree__trash {
  gap: 10px;
  padding-right: 14px;
}

.hub-tree__twist {
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.hub-tree__twist.is-empty {
  cursor: default;
}

.hub-tree__twist:not(.is-empty):hover {
  background: var(--soft-2);
  color: var(--ink);
}

.hub-tree__twist svg {
  width: 15px;
  height: 15px;
  transition: transform 0.16s var(--ease);
}

.hub-tree__twist.is-open svg {
  transform: rotate(90deg);
}

.hub-tree__link {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
  padding: 0 8px 0 4px;
  color: inherit;
  text-decoration: none;
}

.hub-tree__link:focus-visible {
  outline: none;
}

.hub-tree__row:has(> .hub-tree__link:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--line-strong);
}

.hub-tree__link > svg,
.hub-tree__all > svg,
.hub-tree__trash > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

.hub-tree__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-tree__count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* A row's ⋯ sits over its count, shown on hover. */
.hub-tree__row > .menu {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transition: opacity 0.14s;
}

.hub-tree__row:hover > .menu,
.hub-tree__row:focus-within > .menu,
.hub-tree__row > .menu[open] {
  opacity: 1;
}

.hub-tree__row:has(> .menu):is(:hover, :focus-within) .hub-tree__count,
.hub-tree__row:has(> .menu[open]) .hub-tree__count {
  visibility: hidden;
}

@media (hover: none) {
  .hub-tree__row > .menu {
    opacity: 1;
  }

  .hub-tree__row:has(> .menu) .hub-tree__count {
    visibility: hidden;
  }
}

/* The trash sits after all the folders, set apart by a hairline. */
.hub-tree__part {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.hub-tree__empty {
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

/* The ⋯ trigger (dropdown() with no label). */
.hub .hub-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.hub .hub-more:hover,
.hub details[open] > .hub-more {
  background: var(--soft-2);
  color: var(--ink);
}

.hub .hub-more svg {
  width: 18px;
  height: 18px;
}

.hub .hub-more .dropdown__caret {
  display: none;
}

/* Menus in the scrolling sidebar are placed against the viewport (library.js floatingMenu). */
.hub details.hub-float > .menu__panel {
  position: fixed;
  top: var(--float-y, 0);
  left: var(--float-x, 0);
  right: auto;
  z-index: var(--z-menu);
}

/* ------------------------------------------------------------------ the page */

.hub-lib {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.hub-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  min-width: 0;
}

.hub-head__row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}

/* The title with what goes beside it: the folder's ⋯, a collection's kind and Edit. */
.hub-head__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.hub-head__line > .menu {
  margin-left: -2px;
}

.hub-head__side {
  display: none;
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
}

.hub-head__title-wrap {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hub-head__line > .badge {
  flex: 0 0 auto;
}

.hub-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.hub-crumbs__link {
  padding: 2px 6px;
  margin: 0 -2px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
}

.hub-crumbs__link:first-child {
  margin-left: -6px;
}

.hub-crumbs__link:hover {
  background: var(--soft-1);
  color: var(--ink);
}

.hub-crumbs__link.is-drop {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--blue);
  color: var(--ink);
}

.hub-crumbs__sep {
  display: inline-flex;
  color: var(--faint);
}

.hub-crumbs__sep svg {
  width: 13px;
  height: 13px;
}

.hub-head__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hub-head__desc {
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-line;
}

.hub-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.hub-head__meta em {
  color: var(--muted);
  font-style: normal;
}

.hub-head__notes {
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
}

/* ----------------------------------------------------------------- toolbar */

.hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hub-toolbar__filters.is-on {
  border-color: transparent;
  background: var(--soft-2);
}

.hub-toolbar__badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hub-toolbar__count {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hub-toolbar__views .segmented__btn {
  padding: 0 12px;
}

.hub-toolbar__views .segmented__btn svg {
  width: 18px;
  height: 18px;
}

.hub-panel-host,
.hub-chips-host {
  min-width: 0;
}

/* No chips, no row (and no gap for it). */
.hub-chips-host:has(> [hidden]),
.hub-chips-host:has(> :empty),
.hub-chips-host:empty {
  display: none;
}

/* -------------------------------------------------------------- subfolders */

.hub-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.hub-folders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-section-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.hub-folders__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.hub-folder-card {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, opacity 0.16s;
}

.hub-folder-card:hover {
  background: var(--soft-1);
}

.hub-folder-card.is-dragging {
  opacity: 0.4;
}

.hub-folder-card.is-drop {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.hub-folder-card__link {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 6px 11px 11px;
  border-radius: inherit;
  color: var(--ink);
  text-decoration: none;
}

.hub-folder-card__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--soft-2);
  color: var(--muted);
}

.hub-folder-card__icon svg {
  width: 20px;
  height: 20px;
}

.hub-folder-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hub-folder-card__name {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-folder-card__meta {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.hub-folder-card > .menu {
  flex: 0 0 auto;
  margin-right: 6px;
}

/* ------------------------------------------------------------ empty states */

.hub-empty {
  padding: 72px 24px;
}

.hub-empty .empty__actions .btn svg {
  width: 18px;
  height: 18px;
}

.hub-status:empty {
  display: none;
}

.hub-hint {
  color: var(--faint);
  font-size: 14px;
}

.hub-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  color: var(--faint);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.hub-foot:empty {
  min-height: 0;
}

.hub-sentinel {
  height: 1px;
  margin-top: -1px;
}

.hub-skel {
  display: block;
  border-radius: 999px;
  background: var(--soft-2);
  animation: hub-shimmer 1.4s ease-in-out infinite;
}

.hub-skel--title {
  width: 180px;
  height: 26px;
}

.hub-skel--pill {
  width: 120px;
  height: 44px;
}

@keyframes hub-shimmer {
  50% {
    opacity: 0.5;
  }
}

/* -------------------------------------------------------------------- grid */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  transition: opacity 0.2s var(--ease);
}

.hub-grid.is-stale,
.hub-list__body.is-stale {
  opacity: 0.5;
  pointer-events: none;
}

/* -------------------------------------------------------------------- card */

.hub-card {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background: var(--tile);
  box-shadow: var(--shadow-tile);
  color: #fff;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.24s var(--ease), opacity 0.2s;
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}

@media (hover: hover) {
  .hub-card:not(.is-skeleton):hover {
    z-index: 2;
    transform: scale(1.01);
  }
}

.hub-card:focus-visible {
  z-index: 2;
  outline: 2px solid var(--line-strong);
  outline-offset: 3px;
}

.hub-card:active:not(:has(.hub-card__check:active)) {
  transform: scale(0.99);
}

.hub-card.is-dragging {
  opacity: 0.4;
}

/* Selected: a ring inside the card's edge. */
.hub-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 3px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 0.14s;
}

.hub-card.is-selected::after {
  border-color: var(--blue);
}

.hub-card__media {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--tile-color, var(--tile));
}

.hub-card__media {
  background: var(--tile);
}

/* The whole picture, never cropped: a logo keeps its edges, a tall or wide shot sits inside the tile. */
.hub-card__img,
.hub-card__scrub {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
}

.hub-card__scrub {
  z-index: 1;
  opacity: 1;
}

.hub-card__scrubbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  background: #fff;
  transform: scaleX(var(--x, 0));
  transform-origin: left center;
}

/* The title and folder, over a gradient, on hover. */
.hub-card__foot {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 36px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}

.hub-card:hover .hub-card__foot,
.hub-card:focus-visible .hub-card__foot {
  opacity: 1;
}

@media (hover: none) {
  .hub-card__foot {
    opacity: 1;
  }
}

.hub-card.is-video .hub-card__foot {
  padding-right: 72px;
}

.hub-card:has(.hub-card__tick:not([hidden])) .hub-card__foot {
  padding-left: 40px;
}

.hub-card__title,
.hub-card__folder {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-card__title {
  font-size: 14px;
  line-height: 1.25;
}

.hub-card__folder {
  font-size: 12px;
  line-height: 1.25;
  opacity: 0.75;
}

.hub-card.is-failed .hub-card__folder {
  color: #ffb3a7;
  opacity: 1;
}

.hub-card__duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tile-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}

.hub-card__duration svg {
  width: 13px;
  height: 13px;
}

.hub-card__tick {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #1f9d55;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  color: #fff;
  pointer-events: none;
}

.hub-card__tick svg {
  width: 14px;
  height: 14px;
}

/* Uploading, processing, analysing: a ring in the corner (the label on hover). */
.hub-card__state {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  max-width: calc(100% - 52px);
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--tile-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hub-card__ring {
  --p: 0;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(#fff calc(var(--p) * 1turn), rgba(255, 255, 255, 0.28) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  transition: background 0.2s;
}

.hub-card__ring.is-spinning {
  background: conic-gradient(#fff 0 0.28turn, rgba(255, 255, 255, 0.28) 0);
  animation: spin 0.9s linear infinite;
}

.hub-card__label {
  display: none;
  min-width: 0;
  padding-right: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-card:hover .hub-card__label,
.hub-card:focus-visible .hub-card__label {
  display: inline;
}

/* Failed: a red corner whose tooltip says why. */
.hub-card__error {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 46px;
  height: 46px;
  background: linear-gradient(225deg, var(--danger) 50%, transparent 50%);
  color: #fff;
}

.hub-card__error svg {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 15px;
  height: 15px;
}

.hub-card__outdated {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d98a00;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* The checkbox: on hover, when selected, and while anything is selected. */
.hub-card__check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s;
}

.hub-card:hover .hub-card__check,
.hub-card:focus-visible .hub-card__check,
.hub-card.is-selected .hub-card__check,
.has-selection .hub-card__check {
  opacity: 1;
}

@media (hover: none) {
  .hub-card__check {
    opacity: 1;
  }
}

.hub-card__check input {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.hub-card__check input:checked {
  border-color: var(--blue);
  background: var(--blue);
}

.hub-card__check input:checked::after,
.hub-row__check input:checked::after,
.hub-list__head input:checked::after {
  content: '';
  width: 10px;
  height: 5px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}

.hub-card.is-skeleton {
  box-shadow: none;
  background: var(--soft-2);
  cursor: default;
  animation: hub-shimmer 1.4s ease-in-out infinite;
}

/* -------------------------------------------------------------------- list */

.hub-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hub-list__head,
.hub-row {
  display: grid;
  grid-template-columns: 30px 56px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1.2fr) 96px;
  align-items: center;
  column-gap: 14px;
}

.hub-list__head {
  position: sticky;
  top: var(--hub-top);
  z-index: 3;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  color: var(--faint);
  font-size: 13px;
}

.hub-list__body {
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s var(--ease);
}

.hub-row {
  position: relative;
  min-height: 72px;
  padding: 8px 12px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.14s, opacity 0.16s;
}

.hub-row + .hub-row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 12px;
  left: 12px;
  border-top: 1px solid var(--line);
}

@media (hover: hover) {
  .hub-row:hover {
    background: var(--soft-1);
  }

  .hub-row:hover::before,
  .hub-row:hover + .hub-row::before {
    border-top-color: transparent;
  }
}

.hub-row.is-selected {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

.hub-row.is-dragging {
  opacity: 0.4;
}

.hub-row:focus-visible {
  outline-offset: -2px;
}

.hub-row__check,
.hub-list__head label {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.hub-row__check input,
.hub-list__head input {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.hub-row__check input:checked,
.hub-list__head input:checked,
.hub-list__head input:indeterminate {
  border-color: var(--blue);
  background: var(--blue);
}

.hub-list__head input:indeterminate::after {
  content: '';
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.hub-row__thumb {
  position: relative;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--tile);
}

.hub-row__img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
}

.hub-row__name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hub-row__title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
}

.hub-row__title-text,
.hub-row__file,
.hub-row__folder,
.hub-row__media {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-row__tick {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #1f9d55;
  color: #fff;
}

.hub-row__tick svg {
  width: 11px;
  height: 11px;
}

.hub-row__file {
  color: var(--faint);
  font-size: 13px;
}

.hub-row__folder,
.hub-row__media,
.hub-row__when {
  color: var(--muted);
  font-size: 14px;
}

.hub-row__media,
.hub-row__when {
  font-variant-numeric: tabular-nums;
}

.hub-row__status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.hub-row__status .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tags stay on one line: as many as fit. */
.hub-row__tags {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
  mask-image: linear-gradient(to right, #000 85%, transparent);
}

.hub-row__tags .badge {
  flex: 0 0 auto;
}

.hub-row__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: hub-pulse 1.4s ease-in-out infinite;
}

@keyframes hub-pulse {
  50% {
    opacity: 0.3;
  }
}

/* ---------------------------------------------------------------- dragging */

.hub-portal.hub-drag-ghost {
  position: fixed;
  top: -200px;
  left: -200px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}

/* ------------------------------------------------------------- the top bar */

.hub-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 8px 0 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, color-mix(in srgb, var(--bg) 80%, transparent));
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  color: var(--ink);
  transition: background 0.2s var(--ease), box-shadow 0.4s var(--ease-std);
}

.hub-search:hover {
  background: var(--glass-hover);
}

html.is-scrolled .hub-search,
.hub-search:focus-within {
  background: var(--glass);
  box-shadow: var(--shadow-pill);
}

.hub-search__open {
  position: relative;
  display: none;
}

.hub-search.has-value .hub-search__open::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.hub-search__icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}

.hub-search:focus-within .hub-search__icon {
  color: var(--ink);
}

.hub-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.hub-search__input::placeholder {
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}

.hub-search__input::-webkit-search-cancel-button,
.hub-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.hub-search__clear {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.hub-search__clear:hover {
  background: var(--soft-2);
  color: var(--ink);
}

.hub-search__clear svg {
  width: 16px;
  height: 16px;
}

.hub-search__kbd {
  flex: 0 0 auto;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--faint);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.hub-search:focus-within .hub-search__kbd,
.hub-search__input:not(:placeholder-shown) ~ .hub-search__kbd {
  display: none;
}

/* "Ask the hub to translate this", under the field. */
.hub-ask {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  /* As wide as the field, and on a phone (where the field is narrow) wide enough to read. */
  width: max(100%, min(320px, calc(100vw - 88px)));
  z-index: 5;
  padding: 4px;
  border-radius: 22px;
  background: var(--glass-menu);
  -webkit-backdrop-filter: blur(36px) saturate(150%);
  backdrop-filter: blur(36px) saturate(150%);
  box-shadow: var(--shadow-pill);
  transform-origin: top center;
  animation: menu-in 0.2s var(--ease);
}

.hub-ask__button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 16px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.14s;
}

.hub-ask__button:hover,
.hub-ask__button:focus-visible {
  background: var(--soft-1);
  outline: none;
}

.hub-ask__button[disabled] {
  cursor: progress;
  opacity: 0.6;
}

.hub-ask__button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.hub-ask__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hub-ask__text b {
  font-size: 15px;
  font-weight: 500;
}

.hub-ask__text small {
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------------ sheets */

.hub-portal .hub-folder-form {
  gap: 16px;
}

.hub-portal .hub-fold {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hub-portal .hub-fold__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 15px;
  list-style: none;
  cursor: pointer;
}

.hub-portal .hub-fold__summary::-webkit-details-marker {
  display: none;
}

.hub-portal .hub-fold__summary em {
  color: var(--faint);
  font-style: normal;
}

.hub-portal .hub-fold__caret {
  width: 16px;
  height: 16px;
  color: var(--faint);
  transition: transform 0.16s var(--ease);
}

.hub-portal .hub-fold[open] .hub-fold__caret {
  transform: rotate(90deg);
}

.hub-portal .hub-fold__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 18px;
}

.hub-portal .hub-kv {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-portal .hub-kv:empty {
  display: none;
}

.hub-portal .hub-kv__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 36px;
  align-items: center;
  gap: 8px;
}

.hub-portal .hub-kv__row .input {
  height: 44px;
  padding: 0 16px;
}

.hub-portal .hub-kv__remove {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.hub-portal .hub-kv__remove:hover {
  background: var(--soft-2);
  color: var(--danger);
}

.hub-portal .hub-kv__remove svg {
  width: 16px;
  height: 16px;
}

.hub-portal .btn--xs svg {
  width: 15px;
  height: 15px;
}

/* An on / off switch with its explanation. */
.hub-portal .hub-switch {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.14s;
}

.hub-portal .hub-switch:hover {
  background: var(--soft-1);
}

.hub-portal .hub-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hub-portal .hub-switch__track {
  position: relative;
  width: 42px;
  height: 26px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--soft-3);
  transition: background 0.2s var(--ease);
}

.hub-portal .hub-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease);
}

.hub-portal .hub-switch input:checked + .hub-switch__track {
  background: var(--blue);
}

.hub-portal .hub-switch input:checked + .hub-switch__track::after {
  transform: translateX(16px);
}

.hub-portal .hub-switch input:focus-visible + .hub-switch__track {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

.hub-portal .hub-switch__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub-portal .hub-switch__title {
  font-size: 15px;
  line-height: 1.3;
}

.hub-portal .hub-switch__hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* The folder picker. */
.hub-picker-sheet .sheet__panel {
  gap: 18px;
}

.hub-portal .hub-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-portal .hub-picker__search {
  height: 44px;
}

.hub-portal .hub-picker__search::-webkit-search-decoration {
  -webkit-appearance: none;
}

.hub-portal .hub-picker__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 132px;
  max-height: min(48vh, 420px);
  margin: 0 -8px;
  padding: 2px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hub-portal .hub-picker__row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 calc(6px + var(--depth, 0) * 18px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s;
}

.hub-portal .hub-picker__row:hover {
  background: var(--soft-1);
}

.hub-portal .hub-picker__row.is-picked {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
}

.hub-portal .hub-picker__row.is-off {
  cursor: default;
  color: var(--faint);
}

.hub-portal .hub-picker__row.is-off:hover {
  background: transparent;
}

.hub-portal .hub-picker__row.is-off > svg {
  opacity: 0.4;
}

.hub-portal .hub-picker__row > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

.hub-portal .hub-picker__twist {
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--faint);
}

.hub-portal .hub-picker__twist:not(.is-empty):hover {
  background: var(--soft-2);
  color: var(--ink);
}

.hub-portal .hub-picker__twist svg {
  width: 15px;
  height: 15px;
  transition: transform 0.16s var(--ease);
}

.hub-portal .hub-picker__twist.is-open svg {
  transform: rotate(90deg);
}

.hub-portal .hub-picker__name {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hub-portal .hub-picker__name span,
.hub-portal .hub-picker__name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-portal .hub-picker__name small {
  color: var(--faint);
  font-size: 12px;
}

.hub-portal .hub-picker__count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.hub-portal .hub-picker__empty {
  padding: 36px 12px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.hub-portal .hub-picker__foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Web addresses. */
.hub-portal .hub-urls__into {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.hub-portal .hub-urls__into .field__label {
  padding: 0 0 0 4px;
}

.hub-portal .hub-urls__where {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
}

.hub-portal .hub-urls__where svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

.hub-portal .hub-urls__where span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the tour */
/* The frame (.tour, .tour__art, .tour__copy…) is onboarding.css's, and these
   pictures speak its language: drawn photos floating at the edges, panels of
   dark glass, things arriving in order. Each moves only while its slide is the
   current one; still (reduced motion), each shows how it ends. Photos are the
   .art-pic drawings in platform.css. */

.hub-tour .tour__track {
  transform: translateX(calc(var(--hub-tour-i, 0) * -100%));
}

.hub-tour__art {
  display: grid;
  place-items: center;
}

.hub-tour__art > * {
  grid-area: 1 / 1;
}

/* Photos drifting at the edges, like the deck tour's floating cards. */
.hub-tour__float {
  position: absolute;
  width: 112px;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  box-shadow: var(--shadow-tile);
  opacity: 0.92;
  animation: tour-float 7s ease-in-out infinite;
}

.hub-tour__float--1 { top: 24px; left: 6%; rotate: -5deg; }
.hub-tour__float--2 { bottom: 28px; left: 11%; rotate: 4deg; animation-delay: -2s; }
.hub-tour__float--3 { top: 32px; right: 7%; rotate: 5deg; animation-delay: -4s; }
.hub-tour__float--4 { right: 12%; bottom: 24px; rotate: -4deg; animation-delay: -1s; }
.hub-tour__float--5 { top: -36px; left: 33%; rotate: 2deg; animation-delay: -3s; }
.hub-tour__float--6 { right: 33%; bottom: -42px; rotate: -3deg; animation-delay: -5s; }

/* Panels of dark glass, like the deck's search. */
.hub-tour__card,
.hub-tour__panel,
.hub-tour__bar {
  background: #1f1f20;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  color: #fff;
}

/* ------------------------------------------------------------- 1: folders */

.hub-tour__art--folders {
  --loop: 5s;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--blue) 12%, var(--bg)), var(--bg) 66%);
}

.hub-tour__tree {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 290px;
  padding: 12px 10px 10px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
  font-size: 14px;
}

.hub-tour__tree small {
  padding: 0 10px 4px;
  color: var(--muted);
  font-size: 12px;
}

.hub-tour__row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 12px;
}

.hub-tour__row.is-sub {
  padding-left: 30px;
}

.hub-tour__row svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.hub-tour__twist {
  display: grid;
  place-items: center;
  width: 14px;
}

.hub-tour__twist svg {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.hub-tour__twist.is-open svg {
  rotate: 90deg;
}

.hub-tour__name {
  flex: 1 1 auto;
}

.hub-tour__row i {
  color: var(--faint);
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.hub-tour__counts {
  display: grid;
  text-align: right;
}

.hub-tour__counts > span {
  grid-area: 1 / 1;
}

.hub-tour__count-to {
  opacity: 0;
}

/* Three photos, carried across and dropped on Athletes. */
.hub-tour__drag {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 78px;
  height: 58px;
  opacity: 0;
  pointer-events: none;
}

.hub-tour__drag .art-pic {
  grid-area: 1 / 1;
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.hub-tour__drag .art-pic:nth-child(1) { rotate: -9deg; }
.hub-tour__drag .art-pic:nth-child(2) { rotate: 6deg; }

.hub-tour__drag b {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
}

.tour__slide.is-current .hub-tour__drag {
  animation: hub-tour-drag var(--loop) var(--ease) infinite;
}

.tour__slide.is-current .hub-tour__row--3 {
  animation: hub-tour-land var(--loop) infinite;
}

.tour__slide.is-current .hub-tour__count-from {
  animation: hub-tour-out var(--loop) infinite;
}

.tour__slide.is-current .hub-tour__count-to {
  animation: hub-tour-in var(--loop) infinite;
}

@keyframes hub-tour-drag {
  0% {
    opacity: 0;
    transform: translate(190px, 86px) scale(0.92);
  }
  10% {
    opacity: 1;
    transform: translate(170px, 72px) scale(1);
  }
  48% {
    opacity: 1;
    transform: translate(-30px, 22px) scale(0.86);
  }
  56%,
  100% {
    opacity: 0;
    transform: translate(-30px, 22px) scale(0.5);
  }
}

@keyframes hub-tour-land {
  0%,
  38%,
  70%,
  100% {
    background: transparent;
  }
  44%,
  62% {
    background: color-mix(in srgb, var(--blue) 14%, transparent);
    color: var(--blue);
  }
}

@keyframes hub-tour-out {
  0%,
  52% {
    opacity: 1;
  }
  56%,
  94% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes hub-tour-in {
  0%,
  52% {
    opacity: 0;
    transform: translateY(4px);
  }
  58%,
  94% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- 2: drop */

.hub-tour__art--drop {
  --loop: 5s;
  background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 12%, var(--bg)), var(--bg) 72%);
}

.hub-tour__zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 420px;
  height: 220px;
  border: 2px dashed color-mix(in srgb, var(--blue) 45%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
}

.hub-tour__zone small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 510;
}

.hub-tour__zone small svg {
  width: 15px;
  height: 15px;
}

.hub-tour__files {
  display: flex;
  gap: 14px;
}

.hub-tour__fall {
  position: relative;
  display: grid;
  width: 108px;
  height: 80px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.hub-tour__fall > * {
  grid-area: 1 / 1;
}

.hub-tour__dur {
  align-self: start;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
}

.hub-tour__dur svg {
  width: 11px;
  height: 11px;
}

/* The upload, along the bottom edge. */
.hub-tour__ring {
  align-self: end;
  height: 4px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  transform: scaleX(0);
  transform-origin: left;
}

.hub-tour__done {
  place-self: center;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1fa45b;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
}

.hub-tour__done svg {
  width: 16px;
  height: 16px;
}

.hub-tour__fall--2 { --at: 0.35s; }
.hub-tour__fall--3 { --at: 0.7s; }

.tour__slide.is-current .hub-tour__fall {
  animation: hub-tour-fall var(--loop) var(--ease) infinite;
  animation-delay: var(--at, 0s);
}

.tour__slide.is-current .hub-tour__ring {
  animation: hub-tour-fill var(--loop) infinite;
  animation-delay: var(--at, 0s);
}

.tour__slide.is-current .hub-tour__done {
  animation: hub-tour-done var(--loop) var(--ease) infinite;
  animation-delay: var(--at, 0s);
}

@keyframes hub-tour-fall {
  0% {
    opacity: 0;
    transform: translateY(-150px) rotate(-10deg);
  }
  6% {
    opacity: 1;
  }
  16%,
  88% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0;
    transform: none;
  }
}

@keyframes hub-tour-fill {
  0%,
  18% {
    transform: scaleX(0);
    opacity: 1;
  }
  52% {
    transform: scaleX(1);
    opacity: 1;
  }
  58%,
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@keyframes hub-tour-done {
  0%,
  54% {
    opacity: 0;
    transform: scale(0.6);
  }
  62%,
  88% {
    opacity: 1;
    transform: none;
  }
  96%,
  100% {
    opacity: 0;
  }
}

/* ------------------------------------------------------------ 3: describe */

.hub-tour__art--describe {
  --loop: 6.5s;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, #ff8a3d 12%, var(--bg)), var(--bg) 66%);
}

.hub-tour__art--describe .hub-tour__float {
  opacity: 0.55;
}

.hub-tour__card {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 16px;
  width: 470px;
  padding: 14px;
  border-radius: 24px;
}

.hub-tour__shot {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  width: 150px;
  height: 150px;
  overflow: hidden;
  border-radius: 16px;
}

.hub-tour__shot > * {
  grid-area: 1 / 1;
}

/* A light reading the picture, top to bottom. */
.hub-tour__scan {
  height: 45%;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.6) 50%, transparent);
  opacity: 0;
  transform: translateY(-100%);
}

.hub-tour__state {
  position: relative;
  align-self: end;
  justify-self: start;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px;
  margin: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  font-size: 11px;
}

.hub-tour__state svg {
  width: 12px;
  height: 12px;
  color: #ffd36b;
}

.hub-tour__state > span {
  grid-area: 1 / 2;
}

.hub-tour__state-b {
  opacity: 0;
}

.hub-tour__copy {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 6px 4px 0 0;
}

.hub-tour__copy b,
.hub-tour__desc > span {
  width: fit-content;
  border-radius: 6px;
}

.hub-tour__copy b {
  font-size: 15px;
  font-weight: 560;
  line-height: 1.25;
}

.hub-tour__desc {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.4;
}

.hub-tour__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.hub-tour__tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
}

.tour__slide.is-current .hub-tour__scan {
  animation: hub-tour-scan var(--loop) linear infinite;
}

.tour__slide.is-current .hub-tour__state-a {
  animation: hub-tour-out var(--loop) infinite;
}

.tour__slide.is-current .hub-tour__state-b {
  animation: hub-tour-in var(--loop) infinite;
}

.tour__slide.is-current .hub-tour__copy b,
.tour__slide.is-current .hub-tour__desc > span {
  animation: hub-tour-write var(--loop) var(--ease) infinite;
}

.tour__slide.is-current .hub-tour__desc > span:nth-child(1) { animation-delay: 0.25s; }
.tour__slide.is-current .hub-tour__desc > span:nth-child(2) { animation-delay: 0.5s; }
.tour__slide.is-current .hub-tour__desc > span:nth-child(3) { animation-delay: 0.75s; }

.tour__slide.is-current .hub-tour__tag {
  animation: hub-tour-tag var(--loop) var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.16s);
}

@keyframes hub-tour-scan {
  0% {
    opacity: 1;
    transform: translateY(-100%);
  }
  34% {
    opacity: 1;
    transform: translateY(230%);
  }
  36%,
  100% {
    opacity: 0;
    transform: translateY(230%);
  }
}

/* Placeholder lines while the picture is read, then the words. */
@keyframes hub-tour-write {
  0%,
  36% {
    background-color: rgba(255, 255, 255, 0.1);
    color: transparent;
  }
  46%,
  100% {
    background-color: transparent;
    color: inherit;
  }
}

@keyframes hub-tour-tag {
  0%,
  58% {
    opacity: 0;
    transform: scale(0.8);
  }
  64%,
  80% {
    opacity: 1;
    transform: none;
  }
  86%,
  100% {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- 4: find */

.hub-tour__art--find {
  --loop: 6.5s;
  background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 12%, var(--bg)), var(--bg) 72%);
}

.hub-tour__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 380px;
  padding: 10px 10px 12px;
  border-radius: 24px;
}

.hub-tour__search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  font-size: 15px;
}

.hub-tour__search svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.hub-tour__search kbd {
  margin-left: auto;
  font: inherit;
  font-size: 12px;
  opacity: 0.45;
}

.hub-tour__typed {
  overflow: hidden;
  white-space: nowrap;
}

.hub-tour__typed::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 2px;
  background: currentColor;
  vertical-align: text-bottom;
  animation: tour-caret 1.1s steps(1) infinite;
}

.hub-tour__chips {
  display: flex;
  gap: 6px;
  padding: 0 6px;
}

.hub-tour__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.hub-tour__chip svg {
  width: 0;
  height: 12px;
  transition: width 0.2s;
}

.hub-tour__results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0 4px;
}

.hub-tour__result {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
}

.hub-tour__result.is-kept {
  box-shadow: 0 0 0 0 transparent;
}

.hub-tour__count {
  display: grid;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hub-tour__count > span {
  grid-area: 1 / 1;
}

.hub-tour__count-b {
  opacity: 0;
}

.tour__slide.is-current .hub-tour__typed {
  animation: hub-tour-type var(--loop) steps(26) infinite;
}

.tour__slide.is-current .hub-tour__chip {
  animation: hub-tour-chip var(--loop) infinite;
  animation-delay: calc(var(--i) * 0.45s);
}

.tour__slide.is-current .hub-tour__chip svg {
  animation: hub-tour-chip-tick var(--loop) infinite;
  animation-delay: calc(var(--i) * 0.45s);
}

.tour__slide.is-current .hub-tour__result:not(.is-kept) {
  animation: hub-tour-fade var(--loop) var(--ease) infinite;
}

.tour__slide.is-current .hub-tour__result.is-kept {
  animation: hub-tour-keep var(--loop) var(--ease) infinite;
}

.tour__slide.is-current .hub-tour__count-a {
  animation: hub-tour-out var(--loop) infinite;
}

.tour__slide.is-current .hub-tour__count-b {
  animation: hub-tour-in var(--loop) infinite;
}

@keyframes hub-tour-type {
  0% {
    max-width: 0;
  }
  28%,
  100% {
    max-width: 26ch;
  }
}

@keyframes hub-tour-chip {
  0%,
  32% {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
  }
  36%,
  82% {
    background: #fff;
    color: #1f1f20;
  }
  88% {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
  }
  100% {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
  }
}

@keyframes hub-tour-chip-tick {
  0%,
  32% {
    width: 0;
  }
  36%,
  82% {
    width: 12px;
  }
  88% {
    width: 0;
  }
  100% {
    width: 0;
  }
}

@keyframes hub-tour-fade {
  0%,
  40% {
    opacity: 1;
    transform: none;
  }
  54%,
  92% {
    opacity: 0.14;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes hub-tour-keep {
  0%,
  44% {
    box-shadow: 0 0 0 0 transparent;
  }
  56%,
  92% {
    box-shadow: 0 0 0 2px #fff;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---------------------------------------------------------------- 5: bulk */

.hub-tour__art--bulk {
  --loop: 5.5s;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--blue) 12%, var(--bg)), var(--bg) 66%);
}

.hub-tour__tiles {
  display: grid;
  grid-template-columns: repeat(3, 108px);
  gap: 10px;
  margin-bottom: 44px;
}

.hub-tour__tile {
  position: relative;
  display: grid;
  height: 80px;
  border-radius: 12px;
  box-shadow: var(--shadow-tile);
}

.hub-tour__tile > .art-pic {
  grid-area: 1 / 1;
  border-radius: 12px;
}

.hub-tour__tick {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  color: transparent;
}

.hub-tour__tick svg {
  width: 13px;
  height: 13px;
}

.hub-tour__tile--2 { --at: 0.5s; }
.hub-tour__tile--4 { --at: 1s; }

.tour__slide.is-current .hub-tour__tile.is-picked {
  animation: hub-tour-picked var(--loop) var(--ease) infinite;
  animation-delay: var(--at, 0s);
}

.tour__slide.is-current .hub-tour__tile.is-picked .hub-tour__tick {
  animation: hub-tour-pick var(--loop) var(--ease) infinite;
  animation-delay: var(--at, 0s);
}

.hub-tour__bar {
  position: absolute;
  bottom: 26px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 18px 0 20px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 16px);
}

.hub-tour__bar b {
  font-weight: 560;
}

.hub-tour__bar span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.78);
}

.hub-tour__bar svg {
  width: 14px;
  height: 14px;
}

.tour__slide.is-current .hub-tour__bar {
  animation: hub-tour-bar var(--loop) var(--ease) infinite;
}

@keyframes hub-tour-pick {
  0%,
  10% {
    background: rgba(0, 0, 0, 0.18);
    color: transparent;
    transform: none;
  }
  14% {
    transform: scale(1.2);
  }
  18%,
  90% {
    background: var(--blue);
    color: #fff;
    transform: none;
  }
  100% {
    background: rgba(0, 0, 0, 0.18);
    color: transparent;
  }
}

@keyframes hub-tour-picked {
  0%,
  10% {
    box-shadow: var(--shadow-tile);
    transform: none;
  }
  18%,
  90% {
    box-shadow: 0 0 0 3px var(--blue);
    transform: scale(0.95);
  }
  100% {
    box-shadow: var(--shadow-tile);
    transform: none;
  }
}

@keyframes hub-tour-bar {
  0%,
  40% {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
  48%,
  90% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
}

/* ------------------------------------------------------- phones and still */

@media (max-width: 640px) {
  .hub-tour__float {
    display: none;
  }

  .hub-tour__tree,
  .hub-tour__zone,
  .hub-tour__panel,
  .hub-tour__tiles {
    zoom: 0.74;
  }

  .hub-tour__card {
    zoom: 0.66;
  }

  .hub-tour__bar {
    bottom: 14px;
    gap: 10px;
    zoom: 0.82;
  }

  .hub-tour__bar span:nth-of-type(3) {
    display: none;
  }
}

/* Still: each picture as it ends. */
.hub-tour.is-still .hub-tour__float,
.hub-tour.is-still .hub-tour__typed::after {
  animation: none;
}

.hub-tour.is-still .hub-tour__count-from,
.hub-tour.is-still .hub-tour__state-a,
.hub-tour.is-still .hub-tour__count-a,
.hub-tour.is-still .hub-tour__scan,
.hub-tour.is-still .hub-tour__ring,
.hub-tour.is-still .hub-tour__drag {
  opacity: 0;
}

.hub-tour.is-still :is(.hub-tour__count-to, .hub-tour__state-b, .hub-tour__count-b, .hub-tour__done, .hub-tour__bar) {
  opacity: 1;
  transform: none;
}

.hub-tour.is-still .hub-tour__bar {
  transform: translate(-50%, 0);
}

.hub-tour.is-still .hub-tour__chip {
  background: #fff;
  color: #1f1f20;
}

.hub-tour.is-still .hub-tour__chip svg {
  width: 12px;
}

.hub-tour.is-still .hub-tour__result:not(.is-kept) {
  opacity: 0.14;
}

.hub-tour.is-still .hub-tour__tile.is-picked {
  box-shadow: 0 0 0 3px var(--blue);
}

.hub-tour.is-still .hub-tour__tile.is-picked .hub-tour__tick {
  background: var(--blue);
  color: #fff;
}

.hub-tour.is-still .tour__slide.is-current * {
  animation: none !important;
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 1100px) {
  .hub-list__head,
  .hub-row {
    grid-template-columns: 30px 56px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.1fr) 96px;
  }

  .hub-list__head > :nth-child(7),
  .hub-row__tags {
    display: none;
  }
}

@media (max-width: 900px) {
  .hub {
    --hub-top: 72px;
    grid-template-columns: minmax(0, 1fr);
  }

  .hub__main {
    min-height: 0;
    padding-left: 0;
    border-left: 0;
  }

  /* The tree slides in over the page from the left. */
  .hub__side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-side);
    width: min(320px, 86vw);
    max-height: none;
    padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.18);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.26s var(--ease), visibility 0s linear 0.26s;
  }

  .hub.is-side-open .hub__side {
    transform: none;
    visibility: visible;
    transition: transform 0.26s var(--ease);
  }

  .hub__scrim {
    position: fixed;
    inset: 0;
    z-index: var(--z-scrim);
    display: block;
    background: rgba(0, 0, 0, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease);
  }

  .hub.is-side-open .hub__scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .hub--bare .hub__scrim {
    display: none;
  }

  .hub-head__side {
    display: inline-flex;
  }

  .hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .hub-search {
    padding: 0 6px 0 16px;
    background: var(--glass);
    box-shadow: var(--shadow-pill);
  }

  .hub-search__kbd {
    display: none;
  }

  .hub-search__input {
    font-size: 16px;
  }

  .hub-list__head,
  .hub-row {
    grid-template-columns: 30px 56px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr);
  }

  .hub-list__head > :nth-child(4),
  .hub-list__head > :nth-child(8),
  .hub-row__folder,
  .hub-row__when {
    display: none;
  }

  .hub-folders__grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {










}

@media (max-width: 560px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hub-list__head,
  .hub-row {
    grid-template-columns: 30px 48px minmax(0, 1fr) auto;
    column-gap: 10px;
  }

  .hub-row__thumb {
    width: 48px;
    height: 48px;
  }

  .hub-list__head > :nth-child(5),
  .hub-row__media {
    display: none;
  }

  .hub-toolbar__count {
    order: 10;
    width: 100%;
  }

  .hub-empty {
    padding: 56px 16px;
  }
}

/* ---------------------------------------------------------- the workspace */
/* The hub's workspace switcher at the end of the top bar is the deck app's (.ws,
   workspaces.css): folded to the workspaces' marks, it slides out to say Workspaces.
   Only what differs is here: the order of the stack, a long name cut short, and the
   one showing marked in the list. */

/* Folded, every workspace's mark in a stack, as in the deck app, with the one showing
   in front: first, and over the others. */
.hub-ws .ws__dots > * {
  position: relative;
}

.hub-ws .ws__dots > :nth-child(1) {
  z-index: 4;
}

.hub-ws .ws__dots > :nth-child(2) {
  z-index: 3;
}

.hub-ws .ws__dots > :nth-child(3) {
  z-index: 2;
}

.hub-ws .ws__dots > :nth-child(4) {
  z-index: 1;
}

.hub-ws__label {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-ws__choice.is-current {
  background: var(--soft-1);
  font-weight: 500;
}

.hub-ws__choice .ws__name {
  text-align: left;
}

.hub-ws__panel .ws__foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-tree__title .ws-dot {
  margin-right: 8px;
  vertical-align: -2px;
}

.hub-tree__ws {
  display: inline-block;
}

/* A phone: the search folds into a round button beside Add files, and opens across the bar (as in Ideas). */
@media (max-width: 640px) {
  html[data-app='hub'] .topbar__center {
    justify-content: flex-end;
  }

  .hub-search:not(.is-expanded) {
    width: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .hub-search:not(.is-expanded) > :not(.hub-search__open) {
    display: none;
  }

  .hub-search:not(.is-expanded) > .hub-search__open {
    display: inline-flex;
  }

  .topbar.has-hub-search > .topbar__group {
    visibility: hidden;
  }

  .hub-search.is-expanded {
    position: absolute;
    top: 50%;
    right: 8px;
    left: 8px;
    z-index: 3;
    width: auto;
    transform: translateY(-50%);
  }
}

/* A phone: the subfolders in one row that scrolls sideways, so the files start higher. */
@media (max-width: 640px) {
  .hub-folders__grid {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .hub-folders__grid::-webkit-scrollbar {
    display: none;
  }

  .hub-folder-card {
    flex: 0 0 auto;
    width: 200px;
    scroll-snap-align: start;
  }
}
