/* Asset Hub: the detail drawer, the filters panel and chips, the floating
   selection bar, collections, the trash and the hub's settings. Everything sits
   under .hub (the hub's pages) or .hub-portal (sheets and dialogs the hub puts
   on <body>) and uses the tokens in app.css, so dark mode follows. */

:is(.hub, .hub-portal) {
  /* The deck has no success or warning tokens; these are the badges' colours. */
  --hub-ok: #1f9d55;
  --hub-warn: #d98a00;
}

/* ------------------------------------------------------------ shared pieces */

:is(.hub, .hub-portal) .hub-iconbtn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.16s var(--ease-std), transform 0.16s var(--ease);
}

:is(.hub, .hub-portal) .hub-iconbtn:hover {
  background: var(--soft-2);
}

:is(.hub, .hub-portal) .hub-iconbtn:active {
  transform: scale(0.95);
}

:is(.hub, .hub-portal) .hub-iconbtn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

:is(.hub, .hub-portal) .hub-iconbtn svg {
  width: 18px;
  height: 18px;
}

/* A checkbox in the deck's custom style (as on the workspace switcher). */
:is(.hub, .hub-portal) .hub-check {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

:is(.hub, .hub-portal) .hub-check:checked {
  border-color: var(--ink);
  background: var(--ink);
}

:is(.hub, .hub-portal) .hub-check:checked::after {
  content: '';
  width: 9px;
  height: 4.5px;
  border: 2px solid var(--bg);
  border-top: 0;
  border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}

:is(.hub, .hub-portal) .hub-check:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

:is(.hub, .hub-portal) .hub-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hub-ok);
}

:is(.hub, .hub-portal) .hub-dot--busy {
  background: var(--hub-warn);
  animation: hub-dot-pulse 1.4s ease-in-out infinite;
}

:is(.hub, .hub-portal) .hub-dot--error {
  background: var(--danger);
}

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

/* A progress ring: the share done in currentColor; spinning when nobody knows how far along it is. */
:is(.hub, .hub-portal) .hub-ring {
  --size: 16px;
  flex: 0 0 auto;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(currentColor calc(var(--p, 0.28) * 1turn), color-mix(in srgb, currentColor 25%, transparent) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}

:is(.hub, .hub-portal) .hub-ring.is-spinning {
  animation: spin 0.9s linear infinite;
}

:is(.hub, .hub-portal) .hub-mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.92em;
}

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

:is(.hub, .hub-portal) .hub-edited {
  height: 20px;
  padding: 0 8px;
  font-size: 12px;
}

/* Toggle chips: a multi-select of values (feature corrections, tags to remove). */
:is(.hub, .hub-portal) .hub-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

:is(.hub, .hub-portal) .hub-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-input);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s var(--ease-std), border-color 0.15s var(--ease-std), color 0.15s var(--ease-std);
}

:is(.hub, .hub-portal) .hub-toggle:hover {
  background: var(--soft-1);
  border-color: var(--line-strong);
}

:is(.hub, .hub-portal) .hub-toggle[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

:is(.hub, .hub-portal) .hub-toggle:is([disabled], [aria-disabled='true']) {
  opacity: 0.5;
  pointer-events: none;
}

:is(.hub, .hub-portal) .hub-toggle__count {
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

:is(.hub, .hub-portal) .hub-toggle[aria-pressed='true'] .hub-toggle__count {
  color: color-mix(in srgb, var(--bg) 70%, transparent);
}

/* Toasts rise above the selection bar (selection.js measures it: on a phone it can take
   two or three rows), and sit beside the drawer when it is open. */
html.has-hub-selbar .toasts {
  bottom: calc(var(--hub-selbar-h, 56px) + 32px + env(safe-area-inset-bottom, 0px));
}


/* ------------------------------------------------------------ the drawer */

.hub .hub-drawer {
  position: fixed;
  top: var(--hub-top, 84px);
  right: max(0px, calc((100% - 1600px) / 2));
  bottom: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: var(--hub-drawer-w, 480px);
  max-width: 100%;
  border-left: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  opacity: 0;
  transform: translateX(24px);
  transition: transform 0.26s var(--ease), opacity 0.2s var(--ease);
}

/* The shell adds is-open a frame after showing the drawer and takes it off before hiding it. */
.hub .hub__drawer.is-open .hub-drawer {
  opacity: 1;
  transform: none;
}

.hub .hub-drawer:focus {
  outline: none;
}

.hub .hub-drawer__head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.hub .hub-drawer__pos {
  min-width: 72px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

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

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

.hub .hub-drawer__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 16px 20px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

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

.hub .hub-drawer__foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

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

.hub .hub-drawer__tool {
  width: 40px;
  height: 40px;
  background: var(--soft-2);
}

.hub .hub-drawer__tool:hover {
  background: var(--soft-3);
}

.hub .hub-drawer__trash {
  color: var(--danger);
}

/* The preview: the picture or the player, contained in a soft stage. */
.hub .hub-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub .hub-media__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: var(--hub-aspect, 4 / 3);
  max-height: min(52vh, 440px);
  border-radius: 14px;
  background: var(--tile);
  overflow: hidden;
}

.hub .hub-media__stage {
  grid-template: 100% / 100%;
}

.hub .hub-media__stage > * {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
}

.hub .hub-media__stage.is-zoomable {
  cursor: zoom-in;
}

.hub .hub-media__img,
.hub .hub-media__video {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.hub .hub-media__placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--faint);
}

/* No picture yet: a shorter stage, and the status (when there is one) in place of the icon. */
.hub .hub-media__stage.is-empty {
  aspect-ratio: auto;
  height: 200px;
}

.hub .hub-media__stage:has(.hub-media__status.is-solo:not([hidden])) .hub-media__placeholder {
  display: none;
}

.hub .hub-media__status {
  z-index: 3;
  align-self: end;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin: 10px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: var(--tile-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

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

.hub .hub-media__status.is-failed {
  background: color-mix(in srgb, var(--danger) 82%, transparent);
}

/* Nothing to show yet: the ring and the label take the stage's place. */
.hub .hub-media__status.is-solo {
  align-self: center;
  justify-self: center;
  flex-direction: column;
  gap: 12px;
  height: auto;
  margin: 0;
  padding: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-media__status.is-solo .hub-ring {
  --size: 40px;
  color: var(--ink);
}

.hub .hub-media__status.is-solo.is-failed {
  color: var(--danger);
}

.hub .hub-media__status.is-solo svg {
  width: 28px;
  height: 28px;
}

/* The frames strip under a video: each one seeks the player; the current one is ringed. */
.hub .hub-frames {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 3px 3px 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.hub .hub-frames__thumb {
  position: relative;
  flex: 0 0 auto;
  height: 56px;
  min-width: 40px;
  aspect-ratio: var(--hub-aspect, 16 / 9);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--tile);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.16s var(--ease-std);
}

.hub .hub-frames__thumb:hover {
  box-shadow: 0 0 0 2px var(--line-strong);
}

.hub .hub-frames__thumb.is-current {
  box-shadow: 0 0 0 2px var(--blue);
}

.hub .hub-frames__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub .hub-frames__t {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--tile-glass);
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* Title, folder and status. */
.hub .hub-drawer__id {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub .hub-drawer__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
  font-weight: 510;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hub .hub-drawer__rename {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: -4px -8px;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: text;
  transition: background 0.16s var(--ease-std);
}

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

.hub .hub-drawer__pencil {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.16s;
}

.hub .hub-drawer__rename:hover .hub-drawer__pencil,
.hub .hub-drawer__rename:focus-visible .hub-drawer__pencil {
  opacity: 1;
}

.hub .hub-drawer__title-input {
  height: 44px;
  padding: 0 16px;
  font-size: 17px;
  font-weight: 510;
}

.hub .hub-drawer__file {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.hub .hub-drawer__folder {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-drawer__folder-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.hub .hub-drawer__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  min-width: 0;
}

.hub .hub-drawer__crumbs a {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
}

.hub .hub-drawer__sep {
  width: 12px;
  height: 12px;
  color: var(--faint);
}

.hub .hub-drawer__move {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-drawer__status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub .hub-drawer__status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-drawer__status-label {
  color: var(--ink);
}

.hub .hub-drawer__status-sep {
  color: var(--whisper);
}

.hub .hub-drawer__problem {
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
}

.hub .hub-drawer__older,
.hub .hub-drawer__notice {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hub .hub-drawer__notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--soft-1);
}

/* Sections: hairline rows that open and close. */
.hub .hub-sec {
  border-top: 1px solid var(--line);
}

.hub .hub-sec__heading {
  margin: 0;
  font: inherit;
}

.hub .hub-sec__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 14px;
  font-weight: 510;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

.hub .hub-sec__head .badge {
  height: 20px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 450;
}

.hub .hub-sec__sum {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub .hub-sec__caret {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--faint);
  transition: transform 0.2s var(--ease), color 0.16s;
}

.hub .hub-sec__sum + .hub-sec__caret {
  margin-left: 0;
}

.hub .hub-sec__head:hover .hub-sec__caret {
  color: var(--ink);
}

.hub .hub-sec.is-open .hub-sec__caret {
  transform: rotate(180deg);
}

.hub .hub-sec__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 2px 18px;
}

.hub .hub-sec__empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.hub .hub-sec__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Placeholders while the asset or its analysis loads. */
.hub .hub-bone {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--soft-2);
  animation: hub-bone-shimmer 1.4s ease-in-out infinite;
}

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

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

.hub .hub-bone--short {
  width: 60%;
}

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

.hub .hub-bone--media {
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
}

.hub .hub-bone--heading {
  width: 70%;
  height: 22px;
}

.hub .hub-bone--line {
  height: 13px;
}

.hub .hub-bone--block {
  height: 120px;
  border-radius: 14px;
}

/* Label and value rows. */
.hub .hub-facts {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.hub .hub-facts__row {
  display: grid;
  grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.4;
}

.hub .hub-facts__row:first-child {
  padding-top: 0;
  border-top: 0;
}

.hub .hub-facts dt {
  color: var(--muted);
}

.hub .hub-facts dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Text fields of the record. */
.hub .hub-textarea {
  min-height: 88px;
  height: var(--hub-h, auto);
  max-height: 60vh;
  field-sizing: content;
  font-size: 15px;
}

.hub .hub-prose {
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
  text-wrap: pretty;
}

.hub .hub-quotes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  list-style: none;
}

.hub .hub-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

.hub .hub-clamp.is-open {
  display: block;
}

.hub .hub-sec__more {
  align-self: flex-start;
  color: var(--muted);
  font-size: 13px;
}

/* Tags: pills with a ×, and a dashed pill to type a new one. */
.hub .hub-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hub .hub-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--soft-2);
  font-size: 14px;
}

.hub .hub-tag:has(.hub-tag__x) {
  padding-right: 4px;
}

.hub .hub-tag__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.hub .hub-tag__x:hover {
  background: var(--soft-3);
  color: var(--ink);
}

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

.hub .hub-tags__input {
  flex: 1 0 120px;
  min-width: 120px;
  height: 30px;
  padding: 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.hub .hub-tags__input::placeholder {
  color: var(--faint);
}

.hub .hub-tags__input:focus {
  border-style: solid;
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
}

/* What the analysis found. */
.hub .hub-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub .hub-person {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft-1);
  font-size: 14px;
  line-height: 1.45;
}

.hub .hub-person__n {
  font-weight: 510;
}

.hub .hub-person__what {
  color: var(--muted);
}

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

.hub .hub-swatches {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hub .hub-swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.hub .hub-spoken {
  margin: 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hub .hub-ftable {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.4;
}

.hub .hub-ftable__row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.hub .hub-ftable__row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hub .hub-ftable__row--head {
  border-top: 0;
  color: var(--faint);
  font-size: 12px;
}

.hub .hub-ftable__t {
  font-variant-numeric: tabular-nums;
}

/* Features: every correctable key with a control; corrected ones are marked. */
.hub .hub-feats {
  display: flex;
  flex-direction: column;
}

.hub .hub-feats.is-busy {
  cursor: progress;
}

.hub .hub-feat__group {
  margin: 12px 0 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 510;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hub .hub-feat__group:first-child {
  margin-top: 0;
}

.hub .hub-feat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.hub .hub-feat__group + .hub-feat {
  border-top: 0;
}

.hub .hub-feat__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  font-size: 14px;
}

.hub .hub-feat__head .badge {
  height: 20px;
  padding: 0 8px;
  font-size: 12px;
}

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

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

.hub .hub-feat__value {
  color: var(--muted);
  font-size: 14px;
}

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

.hub .hub-select {
  -webkit-appearance: none;
  appearance: none;
  align-self: flex-start;
  max-width: 100%;
  height: 32px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--line-input);
  border-radius: 999px;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.hub .hub-select:hover {
  border-color: var(--line-strong);
}

.hub .hub-select:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
}

.hub .hub-select option {
  color: var(--ink);
  background: var(--surface);
}

.hub .hub-yesno {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--soft-2);
}

.hub .hub-yesno__btn {
  height: 28px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.hub .hub-yesno__btn:hover {
  color: var(--ink);
}

.hub .hub-yesno__btn[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-tile);
}

.hub .hub-yesno__btn:is([disabled], [aria-disabled='true']),
.hub .hub-select:is([disabled], [aria-disabled='true']),
.hub .hub-feat__reset[aria-disabled='true'] {
  opacity: 0.5;
  pointer-events: none;
}

/* The rights form, a little tighter than a sheet's. */
.hub .hub-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub .hub-form .input {
  height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.hub .hub-form select.input {
  padding-right: 40px;
  background-position: right 16px center;
}

/* History and runs. */
.hub .hub-log {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub .hub-log__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.hub .hub-log__row:first-child {
  padding-top: 0;
  border-top: 0;
}

.hub .hub-log__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 14px;
}

.hub .hub-log__what {
  font-weight: 510;
}

.hub .hub-log__change,
.hub .hub-log__outcome {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hub .hub-log__outcome.is-failed {
  color: var(--danger);
}

.hub .hub-log__cost {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

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

/* The footer: review, download, copy, trash. */
.hub .hub-review {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  font-size: 14px;
}

.hub .hub-review__who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub .hub-review.is-done > svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--hub-ok);
}

.hub .hub-review__when {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.hub .hub-review__undo {
  flex: 0 0 auto;
  margin: 0 6px 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.hub .hub-review__mark {
  margin-right: auto;
}

.hub .hub-drawer__error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 8px;
  text-align: center;
}

.hub .hub-drawer__error-title {
  font-size: 17px;
  font-weight: 510;
}

.hub .hub-drawer__error-text {
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.hub .hub-drawer__error-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* The original, full screen. */
.hub-portal.hub-zoom {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.hub-portal.hub-zoom[open] {
  display: grid;
  place-items: center;
}

.hub-portal.hub-zoom::backdrop {
  background: var(--viewer-backdrop);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
}

.hub-portal .hub-zoom__img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: var(--shadow-tile);
  object-fit: contain;
  cursor: zoom-out;
}

.hub-portal .hub-zoom__close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow-pill);
}

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

/* The transcript sheet. */
.hub-portal .hub-transcript__input {
  min-height: 200px;
  font-size: 14px;
}

.hub-portal .hub-transcript__row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.hub-portal .hub-transcript__row > .field {
  flex: 1 1 auto;
}

.hub-portal .hub-transcript__row > .btn {
  flex: 0 0 auto;
  height: 48px;
}

/* ------------------------------------------------------------ filters */

/* The filters are a sheet at the side of the page (the bottom, on a phone), over a scrim. */
.hub-panel-host {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
}

.hub-panel-host__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
}

.hub .hub-filters {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(420px, calc(100vw - 24px));
  padding: 18px 20px 6px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  animation: hub-filters-in 0.22s var(--ease) both;
}

@keyframes hub-filters-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

.hub .hub-filters__done {
  margin-left: 6px;
}

/* A group of the registry's features, folded under its name. */
.hub .hub-filters__fold {
  break-inside: avoid;
  border-top: 1px solid var(--line);
}

.hub .hub-filters__fold-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 510;
  cursor: pointer;
  list-style: none;
}

.hub .hub-filters__fold-summary::-webkit-details-marker {
  display: none;
}

.hub .hub-filters__fold-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.hub .hub-filters__fold-caret {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.18s var(--ease);
}

.hub .hub-filters__fold[open] .hub-filters__fold-caret {
  transform: rotate(180deg);
}

.hub .hub-filters__fold-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 14px;
}

.hub .hub-filters__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hub .hub-filters__title {
  margin: 0;
  font-size: 15px;
  font-weight: 510;
}

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

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

.hub .hub-filters__clear {
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-filters__scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -10px;
  padding: 0 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hub .hub-filters__cols {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hub .hub-filters__block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 18px;
  break-inside: avoid;
}

.hub .hub-filters__group {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 510;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hub .hub-filters__label {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 510;
}

.hub .hub-filters__opts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hub .hub-filters__find {
  height: 34px;
  margin: 2px 0 6px;
  padding: 0 14px;
  font-size: 14px;
}

.hub .hub-filters__more {
  align-self: flex-start;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.hub .hub-filters__none {
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hub .hub-facet {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin: 0 -8px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.14s;
}

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

.hub .hub-facet.is-empty {
  opacity: 0.5;
}

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

.hub .hub-facet__count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s;
}

.hub .hub-filters.is-loading .hub-facet__count {
  opacity: 0.45;
}

/* The active-filter chips. */
.hub .hub-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hub .hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 4px 0 14px;
  border-radius: 999px;
  background: var(--soft-2);
  font-size: 14px;
}

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

.hub .hub-chip__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.hub .hub-chip__x:hover {
  background: var(--soft-3);
  color: var(--ink);
}

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

.hub :is(.hub-chips__clear, .hub-chips__save) {
  margin-left: 6px;
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-chips__save:first-child {
  margin-left: 0;
}

/* ------------------------------------------------------------ selection bar */

.hub .hub-selbar {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow-pill);
  color: var(--ink);
  transform: translateX(-50%);
  animation: hub-selbar-in 0.2s var(--ease);
}


@keyframes hub-selbar-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.97);
  }
}

.hub .hub-selbar__info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 14px;
  font-size: 14px;
  white-space: nowrap;
}

.hub .hub-selbar__count {
  font-weight: 510;
  font-variant-numeric: tabular-nums;
}

.hub .hub-selbar__all {
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-selbar__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.hub .hub-selbar__btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s var(--ease-std), transform 0.16s var(--ease);
}

.hub .hub-selbar__btn:hover,
.hub .hub-selbar .dropdown[open] > summary {
  background: var(--soft-2);
}

.hub .hub-selbar__btn:active {
  transform: scale(0.97);
}

.hub .hub-selbar__btn svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.hub .hub-selbar__btn.is-danger {
  color: var(--danger);
}

.hub .hub-selbar__btn--icon,
.hub .hub-selbar__clear {
  justify-content: center;
  width: 40px;
  padding: 0;
}

.hub .hub-selbar__btn--icon .hub-selbar__label {
  display: none;
}

.hub .hub-selbar__sep {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--line-strong);
}

.hub .hub-selbar.is-busy :is(.hub-selbar__tools, .hub-selbar__all) {
  opacity: 0.5;
  pointer-events: none;
}

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

/* The bar sits at the bottom of the screen, so its menus open upwards. */
.hub .hub-selbar .menu__panel {
  top: auto;
  bottom: calc(100% + 12px);
}

.hub .hub-selbar .menu[open] .menu__panel {
  transform-origin: bottom right;
  animation-name: hub-menu-up;
}

@keyframes hub-menu-up {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(4px);
  }
}

/* ------------------------------------------------------------ pages */

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

.hub .hub-pagehead__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

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

/* Collections. */
.hub .hub-colls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.hub .hub-colls > .empty {
  grid-column: 1 / -1;
}

.hub .hub-coll {
  position: relative;
  gap: 8px;
  padding: 20px 22px;
  transition: border-color 0.16s var(--ease-std);
}

.hub .hub-coll:hover {
  border-color: var(--line-strong);
}

.hub .hub-coll__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.hub .hub-coll__title {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 510;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hub .hub-coll__link {
  text-decoration: none;
}

/* The whole card opens the collection; the ⋯ menu sits above that. */
.hub .hub-coll__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
}

.hub .hub-coll__head > .menu {
  position: relative;
  z-index: 1;
  margin-left: auto;
}

.hub .hub-coll__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

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

.hub-portal .hub-filterbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--soft-1);
}

.hub-portal .hub-filterbox__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hub-portal .hub-filterbox__chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--soft-2);
  font-size: 13px;
}

.hub-portal :is(.hub-filterbox__note, .hub-collsheet__hint) {
  color: var(--faint);
  font-size: 13px;
  line-height: 1.45;
}

/* The trash. */
.hub .hub-trash__part {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub .hub-trash__heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 510;
}

.hub .hub-trash__count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.hub .hub-trash__rows {
  padding: 2px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.hub .hub-trash__hint {
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-trash__more {
  display: flex;
  justify-content: center;
}

/* A trashed asset: its card, and under it when it went, by whom, with which folder. */
.hub .hub-trash__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hub .hub-trash__when {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Viewers can't restore or delete: no tick boxes, and the cards don't look pressable. */
.hub .hub-trash.is-readonly .hub-card__check {
  display: none;
}

.hub .hub-trash.is-readonly .hub-card {
  cursor: default;
}

/* Settings (cards as on the deck's settings page). */
.hub .hub-settings__form {
  max-width: 640px;
}

.hub .hub-settings__note {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hub .hub-settings__frames {
  max-width: 160px;
}

.hub .hub-settings__key {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--soft-1);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.hub .hub-settings__spend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

.hub .hub-stat {
  font-size: 28px;
  font-weight: 510;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hub .hub-stat__label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-settings__meter .progress__bar {
  width: var(--hub-pct, 0%);
}

.hub .hub-settings__meter.is-near .progress__bar {
  background: var(--hub-warn);
}

.hub .hub-settings__meter.is-over .progress__bar {
  background: var(--danger);
}

.hub .hub-settings__pause-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

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

.hub .hub-table {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}

.hub .hub-table :is(th, td) {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.hub .hub-table tr:first-child > * {
  border-top: 0;
}

.hub .hub-table th {
  color: var(--ink);
  font-weight: 400;
  text-align: left;
}

.hub .hub-table__num {
  padding-left: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hub .hub-table__extra {
  width: 64px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hub .hub-table tr.is-warn .hub-table__num {
  color: color-mix(in srgb, #b26b00 85%, var(--ink));
}

.hub .hub-table tr.is-error .hub-table__num {
  color: var(--danger);
}

.hub .hub-table tr.is-sub th {
  padding-left: 16px;
  color: var(--muted);
  font-size: 14px;
}

.hub .hub-table tr.is-sub td {
  color: var(--muted);
  font-size: 14px;
}

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

.hub .row.is-revoked .row__title {
  color: var(--faint);
}

.hub .hub-settings__role {
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.hub-portal .hub-keybox {
  font-size: 13px;
}

.hub-portal .hub-scopes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hub-portal .hub-scopes legend {
  margin-bottom: 6px;
}

.hub-portal .hub-scope {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.14s;
}

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

.hub-portal .hub-scope .hub-check {
  margin-top: 1px;
}

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

.hub-portal .hub-scope__name {
  font-size: 15px;
}

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

/* ------------------------------------------------------------ narrower */

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

  .hub .hub-selbar__btn {
    justify-content: center;
    width: 40px;
    padding: 0;
  }
}

@media (max-width: 900px) {
  .hub .hub-drawer {
    top: var(--hub-top, 72px);
  }
}

/* Phones: the drawer takes the whole screen, the bar the whole width. */
@media (max-width: 760px) {
  .hub .hub-drawer {
    top: 0;
    left: 0;
    right: 0;
    z-index: 70;
    width: auto;
    border-left: 0;
  }

  .hub .hub-selbar {
    left: 12px;
    right: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
    border-radius: 26px;
    transform: none;
    animation-name: hub-selbar-up;
  }

  /* A phone: the filters come up from the bottom. */
  .hub .hub-filters {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: 82vh;
    border-radius: 24px 24px 0 0;
    animation-name: hub-filters-up;
  }

  @keyframes hub-filters-up {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
  }

  .hub-portal .hub-transcript__row {
    flex-direction: column;
    align-items: stretch;
  }
}

@keyframes hub-selbar-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (min-width: 1600px) {
  .hub .hub-drawer {
    border-right: 1px solid var(--line);
  }
}

/* Wider screens: the drawer pops up over the dimmed page, the preview large on the left and
   everything about it on the right, each side scrolling on its own. */
@media (min-width: 761px) {
  html.has-drawer[data-app='hub'] {
    overflow: hidden;
  }

  .hub .hub__drawer:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: color-mix(in srgb, #05070b 48%, transparent);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
  }

  .hub .hub__drawer.is-open {
    opacity: 1;
  }

  .hub .hub-drawer {
    position: fixed;
    inset: 0;
    z-index: 91;
    margin: auto;
    width: min(1440px, calc(100% - 64px));
    height: min(920px, calc(100% - 64px));
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    transform: translateY(12px) scale(0.985);
  }

  .hub .hub-drawer__head {
    padding: 10px 14px;
    border-radius: 20px 20px 0 0;
    background: var(--bg);
  }

  .hub .hub-drawer__foot {
    border-radius: 0 0 20px 20px;
  }

  .hub .hub-drawer__body {
    flex-direction: row;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  .hub .hub-drawer__stage {
    display: flex;
    flex: 1.4 1 0;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
    border-right: 1px solid var(--line);
    background: var(--tile);
    overflow-y: auto;
  }

  .hub .hub-drawer__stage .hub-media {
    flex: 1 1 auto;
    min-height: 0;
  }

  .hub .hub-drawer__stage .hub-media__stage {
    flex: 1 1 auto;
    min-height: 240px;
    aspect-ratio: auto;
    max-height: none;
    background: transparent;
  }

  .hub .hub-drawer__info {
    flex: 1 1 0;
    min-width: 380px;
    max-width: 620px;
    padding: 22px 28px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .hub .hub-drawer {
    width: calc(100% - 32px);
    height: calc(100% - 32px);
  }

  .hub .hub-drawer__stage {
    flex-basis: 0;
    flex-grow: 1;
  }

  .hub .hub-drawer__info {
    min-width: 320px;
  }
}

/* A phone: a trashed folder's buttons go under its name, so the name keeps its width. */
@media (max-width: 640px) {
  .hub .hub-trash__row {
    flex-wrap: wrap;
  }

  .hub .hub-trash__row .row__main {
    flex-basis: calc(100% - 110px);
  }

  .hub .hub-trash__row .row__actions {
    flex-basis: 100%;
    justify-content: flex-end;
  }
}
