/* The Library (library/view.js: assets, Inbox, Game notes), an asset's page (library/asset.js),
   the note composer, the upload dialog and tray and the drop zone (library/ui.js).
   The asset page is design/redesign-2026-10/theme.css "screen: library asset" and its responsive
   rules; the list, inbox and notes views compose the shared components (NOTES.md §11). */

/* ---------------------------------------------------------------- the library's frame */
.library .lib,
.library .av-wrap {
  min-width: 0;
}
.lib-head {
  align-items: flex-end;
}
.lib-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
/* the Assets / Inbox / Game notes switch: a seg of links */
.lib-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: var(--fs-13);
  font-weight: 560;
  color: var(--ink-3);
  white-space: nowrap;
  transition-property: background-color, color, box-shadow;
  transition-duration: var(--t-fast);
}
.lib-tabs a:hover {
  color: var(--ink);
}
.lib-tabs a[aria-current='page'] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.lib-tabs .n {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--ink-4);
}
.lib-loading {
  padding: 24px 0;
}
.lib-pane {
  display: grid;
  gap: 16px;
  min-width: 0;
}
a.chip[aria-current='true'] {
  color: var(--bg);
  background: var(--ink);
  box-shadow: none;
}
a.chip[aria-current='true'] .n {
  color: inherit;
  opacity: 0.75;
}

/* ---------------------------------------------------------------- assets */
.lib-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.lib-filters > .chip-row {
  flex: 0 1 auto;
}
.lib-filters-sp {
  flex: 1;
}
.lib-status {
  width: auto;
  height: 36px;
  padding-right: 8px;
}
.lib-filters .search {
  flex: 0 1 240px;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}
.acard {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition-property: box-shadow, translate;
  transition-duration: var(--t-fast);
  transition-timing-function: var(--ease);
}
.acard:hover {
  box-shadow: var(--shadow-2);
}
.acard:active {
  translate: 0 1px;
}
.acard > .media {
  margin: 6px 6px 0;
  border-radius: 8px; /* 14 card - 6 inset */
}
.acard[data-status='archived'] > .media {
  opacity: 0.6;
}
.acard-body {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px 12px 12px;
  min-width: 0;
}
.acard-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.acard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-15);
  font-weight: 650;
}
.acard-ver {
  flex: none;
  font-size: var(--fs-13);
  font-weight: 650;
  color: var(--ink-3);
}
.acard-top .t-tiny {
  margin-left: auto;
  white-space: nowrap;
}
.acard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.acard-notes,
.rv-note-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-amber));
}
.lib-empty {
  padding: 8px;
}

/* a picture's or a file's stand-in while it loads, or when it has none */
.thumb-blank {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 6px;
  font: 600 11px/1.2 var(--font-sans);
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}
.media > .thumb-blank,
.att > .thumb-blank {
  position: absolute;
  inset: 0;
}
.media > img + .thumb-blank,
.media > .thumb-blank[hidden] {
  display: none;
}
.media .badge .i {
  width: 12px;
  height: 12px;
}

/* ---------------------------------------------------------------- inbox */
.ib-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.ib-col {
  min-width: 0;
}
.ib-col .section-head .t-h2 .count {
  margin-left: 2px;
}
.ib-list {
  list-style: none;
  display: grid;
  margin: 0;
  overflow: hidden;
}
.ib-list > li + li {
  box-shadow: inset 0 1px 0 var(--line);
}
.ib-link {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  transition: background-color var(--t-fast) var(--ease);
}
.ib-link:hover {
  background: var(--hover);
}
.ib-thumb {
  border-radius: var(--r-2);
}
.ib-thumb.is-file {
  background: var(--surface-2);
}
.ib-thumb.is-file .thumb-blank {
  color: var(--ink-3);
}
.ib-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ib-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}
.ib-what {
  font-size: var(--fs-14);
  font-weight: 600;
  min-width: 0;
}
.ib-text {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--fs-13);
  color: var(--ink-2);
  line-height: 1.45;
  text-wrap: pretty;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ib-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  font-size: var(--fs-12);
  color: var(--ink-3);
  min-width: 0;
}
.ib-meta > * {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.ib-meta > .ib-reply {
  display: flex;
  flex: 1 1 100%;
  min-width: 0;
}
.ib-empty {
  padding: 4px;
}
.ib-note[data-state='routed'] .ib-link {
  opacity: 0.85;
}

/* ---------------------------------------------------------------- game notes */
.gn-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
.gn-main {
  min-width: 0;
}
.gn-list {
  margin: 0;
  padding: 4px 0;
}
.gn-side {
  position: sticky;
  top: 130px;
  display: grid;
  gap: 4px;
  overflow: hidden;
}
.gn-side-head {
  display: grid;
  gap: 4px;
  padding: 16px 18px 6px;
}

/* ---------------------------------------------------------------- notes (asset page, game notes) */
.note-list {
  list-style: none;
  margin: 0;
}
.note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px 12px;
  padding: 12px 18px;
  scroll-margin: 140px 0 120px;
  transition: background-color var(--t-med) var(--ease);
}
.note + .note {
  box-shadow: inset 0 1px 0 var(--line);
}
.note > :not(:first-child) {
  grid-column: 2;
  min-width: 0;
}
.note > .avatar {
  margin-top: -2px;
}
.note.is-focus {
  background: var(--accent-soft);
}
.note.is-new {
  animation: note-in var(--t-med) var(--ease-out);
}
@keyframes note-in {
  from {
    opacity: 0;
    translate: 0 4px;
  }
}
.note-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: var(--fs-13);
}
.note-top b,
.note-author {
  font-weight: 650;
}
.note-top .status {
  margin-left: auto;
}
.note-src {
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.note-at {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-12);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
button.note-at {
  border-radius: 5px;
  transition: color var(--t-fast) var(--ease);
}
button.note-at:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.note-text {
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-wrap: pretty;
}
.note[data-state='fixed'] > .note-text,
.note[data-state='wontfix'] > .note-text {
  color: var(--ink-2);
}
.note-reply {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--r-3);
  background: var(--surface-2);
  font-size: var(--fs-13);
  overflow-wrap: anywhere;
}
.note-reply.is-person {
  padding: 2px 0 2px 12px;
  border-radius: 0;
  background: none;
  box-shadow: inset 2px 0 0 var(--line-2);
}
.note-reply-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.note-reply-top b {
  font-weight: 650;
  font-size: var(--fs-12);
  color: var(--ink-2);
}
.note-reply-top .label {
  height: 18px;
  font-size: 11px;
}
.note-reply p {
  white-space: pre-wrap;
  text-wrap: pretty;
}
.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  font-size: var(--fs-13);
}
.note-meta .btn.is-link {
  font-size: var(--fs-13);
  gap: 4px;
}
.reply-box {
  display: contents;
}
.reply-form {
  display: grid;
  gap: 8px;
  width: 100%;
}
.reply-form .textarea {
  min-height: 64px;
}
.note-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.att {
  position: relative;
  width: 72px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--r-2);
  background: var(--stage);
  box-shadow: inset 0 0 0 1px var(--img-outline);
}
.att img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.att.is-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: 220px;
  height: 30px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-12);
}

/* ---------------------------------------------------------------- the note composer */
/* The composer's own look (.composer, .composer-input, .composer-foot) is chat.css's; these rules
   keep the note box whole on its own and give it theme.css's note-composer shape. */
.note-composer {
  margin: 0;
  padding: 12px;
  box-shadow: inset 0 1px 0 var(--line);
}
.note-composer .composer {
  position: relative;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow var(--t-med) var(--ease);
}
.note-composer .composer:focus-within {
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft);
}
.note-composer.is-drop .composer {
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 3px var(--accent-soft);
}
.note-composer.is-declining .composer {
  box-shadow: inset 0 0 0 1.5px oklch(var(--tone-dot-l) var(--tone-dot-c) var(--hue-red) / 0.6);
}
.note-composer .composer-input {
  display: block;
  width: 100%;
  min-height: 64px;
  max-height: 40dvh;
  padding: 12px 14px 4px;
  border: 0;
  background: none;
  resize: none;
  field-sizing: content;
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--ink);
}
.note-composer .composer-input:focus {
  outline: none;
}
.note-composer .composer-input::placeholder {
  color: var(--ink-4);
}
.note-composer .composer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 8px 8px;
}
.note-composer .composer-foot .hint {
  margin-left: auto;
  margin-right: 6px;
  font-size: var(--fs-12);
  color: var(--ink-4);
  white-space: nowrap;
}
.note-composer .composer-foot .btn.is-accent {
  margin-left: 4px;
}
.composer-extra {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.composer-extra:empty {
  display: none;
}
.note-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 12px 0;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.note-target[hidden] {
  display: none;
}
.note-target > .i {
  flex: none;
}
.note-target > span:not(.tok) {
  flex: 1 1 12rem;
  min-width: 0;
  text-wrap: pretty;
}
.note-target > .note-target-what {
  flex: none;
}
.note-target-what {
  font-weight: 650;
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-red));
}
.tok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 4px 0 8px;
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: 560;
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-blue));
  background: oklch(var(--tone-dot-l) var(--tone-dot-c) var(--hue-blue) / var(--tone-fill-a));
}
.tok-x {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: inherit;
}
.tok-x:hover {
  background: var(--hover);
}
.composer-atts {
  list-style: none;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 4px 12px 0;
}
.composer-atts:empty {
  display: none;
}
.catt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 72px auto;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-12);
  color: var(--ink-2);
}
.catt .meter {
  --h: var(--hue-blue);
}
.catt[data-state='done'] .meter {
  --h: var(--hue-green);
}
.catt[data-state='failed'] {
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-red));
}
.composer-msg {
  padding: 4px 14px 0;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.composer-msg:empty {
  display: none;
}
.composer-msg[data-kind='warn'] {
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-amber));
}

/* ---------------------------------------------------------------- an asset's page (theme.css "screen: library asset") */
.asset-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 20px;
}
.asset-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.asset-title .t-title {
  overflow-wrap: anywhere;
}
.asset-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.asset-tools {
  justify-content: flex-end;
}
.asset-tools[hidden] {
  display: none;
}
.asset-tools .btn .t-tiny {
  font-weight: 500;
}
.asset-decide {
  display: inline-flex;
  gap: 8px;
}
.asset-decide[hidden] {
  display: none;
}
.asset-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: -6px 0 18px;
  padding: 10px 14px;
}
.asset-state {
  display: grid;
  gap: 6px;
  padding: 24px;
}
.asset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas: 'stage notes' 'more notes';
  gap: 0 24px;
  align-items: start;
}
.asset-layout[hidden] {
  display: none;
}
.asset-stage {
  grid-area: stage;
  min-width: 0;
}
.asset-more {
  grid-area: more;
  min-width: 0;
}
.asset-layout > .notes {
  grid-area: notes;
}

/* the stage: the media at its own aspect ratio, letterboxed on the stage colour */
.stage-slot {
  display: grid;
  min-width: 0;
}
.stage,
.cmp-view {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--r-5);
  background: var(--stage);
  isolation: isolate;
}
.stage::after,
.cmp-view::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--img-outline);
  pointer-events: none;
}
.stage-fit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
}
.stage-canvas {
  position: relative;
  max-width: 100%;
  touch-action: manipulation;
}
.stage-canvas.can-pin {
  cursor: crosshair;
}
.stage-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.stage-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #b9b5aa;
  font-size: var(--fs-13);
  text-align: center;
  pointer-events: none;
}
.stage .pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* a note's pin: its number in its state's hue (amber open, blue routed, green fixed, grey won't fix) */
.pin {
  --h: var(--hue-amber);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  font: 700 11.5px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: oklch(calc(var(--tone-dot-l) - 0.04) calc(var(--tone-dot-c) * var(--chroma)) var(--h));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.35);
  translate: -50% -50%;
}
.pin.s-routed {
  --h: var(--hue-blue);
}
.pin.s-fixed {
  --h: var(--hue-green);
}
.pin.s-wontfix {
  --chroma: 0;
}
.note .pin,
.pin.is-inline {
  translate: none;
  box-shadow: none;
}
.pins .pin {
  position: absolute;
  z-index: 2;
  min-width: 24px;
  width: auto;
  padding: 0 6px;
  border-radius: 12px;
  pointer-events: auto;
  cursor: pointer;
  transition-property: scale, opacity, box-shadow;
  transition-duration: var(--t-fast);
  transition-timing-function: var(--ease);
}
.pins .pin::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}
.pins .pin:hover,
.pins .pin.is-focus {
  scale: 1.15;
}
.pins .pin.is-focus {
  box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.pins .pin.is-corner {
  translate: -35% -35%;
}
.pins .pin.s-fixed {
  opacity: 0.9;
}
.pins .pin.is-off,
.pin-region.is-off {
  opacity: 0;
  pointer-events: none;
}
.pins .pin.is-draft {
  --h: var(--hue-clay);
  font-size: 15px;
  pointer-events: none;
  animation: dot-pulse 1.8s var(--ease) infinite;
}
.pin-region {
  --h: var(--hue-amber);
  position: absolute;
  border: 2px solid oklch(var(--tone-dot-l) var(--tone-dot-c) var(--h));
  border-radius: 4px;
  background: oklch(var(--tone-dot-l) var(--tone-dot-c) var(--h) / 0.1);
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.pin-region[data-state='routed'] {
  --h: var(--hue-blue);
}
.pin-region[data-state='fixed'] {
  --h: var(--hue-green);
  background: transparent;
}
.pin-region[data-state='wontfix'] {
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
}
.pin-region.is-draft,
.draw-rect {
  position: absolute;
  border: 2px dashed var(--accent);
  border-radius: 4px;
  background: var(--accent-soft);
  pointer-events: none;
}
.pin-pop {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 6px;
  width: min(280px, 78vw);
  padding: 12px 14px;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  translate: -50% calc(-100% - 20px);
  cursor: default;
}
.pin-pop.is-below {
  translate: -50% 20px;
}
.pin-pop.is-left {
  translate: calc(-100% + 22px) calc(-100% - 20px);
}
.pin-pop.is-left.is-below {
  translate: calc(-100% + 22px) 20px;
}
.pin-pop.is-right {
  translate: -22px calc(-100% - 20px);
}
.pin-pop.is-right.is-below {
  translate: -22px 20px;
}
.pop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: var(--fs-13);
}
.pop-head b {
  font-weight: 650;
}
.pop-head .status {
  margin-left: auto;
}
.pop-text {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--fs-13);
  line-height: 1.45;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.pop-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.pin-pop .btn.is-link {
  justify-self: start;
  font-size: var(--fs-13);
}

/* a sound: its waveform picture, or bars */
.wave {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.wave-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wave-bars {
  position: absolute;
  inset: 12% 2%;
  display: flex;
  align-items: center;
  gap: 2px;
}
.wave-bars i {
  flex: 1;
  border-radius: 1px;
  background: oklch(0.74 0.12 var(--hue-teal));
  opacity: 0.85;
}
.wave-head {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #fff;
  pointer-events: none;
}

/* the timeline under a clip or a sound: it stays on the stage's dark */
.tl {
  position: relative;
  z-index: 7;
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--stage) 92%, #fff 8%);
  color: #f4f2ec;
}
.tl .icon-btn {
  color: #e9e6dd;
}
.tl .icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.tl .btn {
  color: #f4f2ec;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.tl .btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.tl-time {
  min-width: 12ch;
  font-size: var(--fs-12);
  color: #b9b5aa;
  white-space: nowrap;
}
.tl-track {
  position: relative;
  flex: 1;
  min-width: 80px;
  height: 36px;
}
.tl-rail {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
}
.tl-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}
.tl-range {
  position: absolute;
  bottom: 0;
  left: -7px;
  width: calc(100% + 14px);
  height: 20px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.tl-range::-webkit-slider-runnable-track {
  height: 20px;
  background: transparent;
}
.tl-range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  -webkit-appearance: none;
}
.tl-range::-moz-range-track {
  background: transparent;
}
.tl-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
.tl-range:focus-visible {
  outline: none;
}
.tl-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--focus);
}
.tl-marks {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 16px;
  pointer-events: none;
}
.tl-mark {
  --h: var(--hue-amber);
  position: absolute;
  top: 0;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: oklch(calc(var(--tone-dot-l) - 0.04) calc(var(--tone-dot-c) * var(--chroma, 1)) var(--h));
  color: #fff;
  font: 700 10.5px/16px var(--font-sans);
  translate: -50% 0;
  pointer-events: auto;
  cursor: pointer;
}
.tl-mark.s-routed {
  --h: var(--hue-blue);
}
.tl-mark.s-fixed {
  --h: var(--hue-green);
}
.tl-mark.s-wontfix {
  --chroma: 0;
}
.tl-mark::after {
  content: '';
  position: absolute;
  top: 100%;
  left: calc(50% - 1px);
  width: 2px;
  height: 8px;
  background: inherit;
}
.tl-mark::before {
  content: '';
  position: absolute;
  inset: -6px -3px;
}
.tl-draft {
  position: absolute;
  bottom: 4px;
  width: 3px;
  height: 12px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
}

/* the media bar and the thumbnails */
.stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0;
  font-size: var(--fs-13);
  color: var(--ink-3);
}
.stage-bar[hidden] {
  display: none;
}
.stage-bar b {
  color: var(--ink);
  font-weight: 650;
}
.stage-what {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}
.stage-cap {
  min-width: 0;
  overflow-wrap: anywhere;
}
.stage-bar .btn-row {
  margin-left: auto;
  gap: 4px;
}
.stage-pos {
  min-width: 6ch;
  text-align: center;
}
.asset-thumbs {
  margin-bottom: 4px;
}
.asset-thumbs[hidden] {
  display: none;
}
.thumb {
  text-align: left;
  border-radius: var(--r-3);
}
.thumb .thumb-cap {
  display: block;
}
.thumb:hover .media {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--line-2);
}
.thumb[aria-current='true'] {
  color: var(--ink);
}
.thumb-notes {
  background: oklch(calc(var(--tone-dot-l) - 0.06) var(--tone-dot-c) var(--hue-amber));
}

/* before and after */
.cmp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cmp-bar[hidden] {
  display: none;
}
.cmp-bar .select {
  width: auto;
  height: 32px;
  padding: 0 8px;
}
.cmp-title {
  font-size: var(--fs-13);
  font-weight: 650;
  color: var(--ink-2);
}
.cmp-sp {
  flex: 1;
}
.cmp-slider {
  position: relative;
  overflow: hidden;
  user-select: none;
}
.cmp-layer {
  position: absolute;
  inset: 0;
}
.cmp-layer img,
.cmp-layer video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cmp-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.cmp-handle b {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.cmp-handle b::before {
  content: '‹ ›';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #1b1a17;
  font: 700 14px/1 var(--font-sans);
}
.cmp-slider:focus-within .cmp-handle b {
  box-shadow: 0 0 0 3px var(--focus), 0 2px 10px rgba(0, 0, 0, 0.5);
}
.cmp-tag {
  position: absolute;
  top: 10px;
  z-index: 2;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(20, 20, 18, 0.62);
  color: #fff;
  font: 600 11.5px/22px var(--font-sans);
  pointer-events: none;
}
.cmp-tag.is-left {
  left: 10px;
}
.cmp-tag.is-right {
  right: 10px;
}
.cmp-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: ew-resize;
}
.cmp-sbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 220px;
  padding: 8px;
}
.cmp-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  margin: 0;
}
.cmp-pane figcaption {
  font-size: var(--fs-12);
  font-weight: 600;
  color: #cfccc3;
}
.cmp-media {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
}
.cmp-media img,
.cmp-media video {
  display: block;
  max-width: 100%;
  max-height: 62dvh;
  border-radius: var(--r-2);
  object-fit: contain;
}
.cmp-media audio {
  width: 100%;
}
.cmp-missing {
  font-size: var(--fs-12);
  color: #b9b5aa;
}

/* versions and about */
.versions {
  list-style: none;
  display: grid;
  margin: 0;
}
.version {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: start;
  padding: 14px 16px;
}
.version + .version {
  box-shadow: inset 0 1px 0 var(--line);
}
.version[aria-current='true'] {
  background: var(--surface-2);
}
.version .v {
  font-family: var(--font-serif);
  font-size: var(--fs-20);
  line-height: 1;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.version p {
  margin-top: 2px;
  font-size: var(--fs-13);
  color: var(--ink-3);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.version-open {
  font-size: var(--fs-14);
  font-weight: 600;
  text-align: left;
  color: var(--ink);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.version-open:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.asset-about {
  padding: 16px 18px;
}
.asset-about .btn.is-link {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

/* the notes panel: sticky beside the stage on wide screens */
.notes {
  position: sticky;
  top: 130px;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 150px);
  overflow: hidden;
}
.notes-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px 18px;
  box-shadow: inset 0 -1px 0 var(--line);
}
.notes-head h2 {
  font-size: var(--fs-15);
  font-weight: 650;
}
.notes-head .seg {
  margin-left: auto;
}
.notes .note-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0;
}
.note-empty {
  flex: 1;
  padding: 20px 18px;
}
.notes-composer {
  flex: none;
}
.notes-readonly {
  padding: 12px 18px 16px;
  box-shadow: inset 0 1px 0 var(--line);
}

/* ---------------------------------------------------------------- upload dialog, tray, drop zone */
.up-drop {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-4);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.up-files {
  list-style: none;
  display: grid;
  margin: 0;
}
.up-files[hidden] {
  display: none;
}
.up-files li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: var(--fs-13);
}
.up-files li + li {
  box-shadow: inset 0 1px 0 var(--line);
}
.up-files li.is-big .trunc {
  color: var(--ink-3);
}
.up-empty {
  font-size: var(--fs-13);
  color: var(--ink-3);
}
.utray {
  position: fixed;
  z-index: 65;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 2px;
  width: min(340px, calc(100% - 32px));
  padding: 6px;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.utray[hidden] {
  display: none;
}
.ut-row {
  display: grid;
  gap: 6px;
  padding: 8px 8px 10px;
}
.ut-row + .ut-row {
  box-shadow: inset 0 1px 0 var(--line);
}
.ut-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: var(--fs-13);
}
.ut-top > .i {
  color: var(--ink-3);
}
.ut-top .trunc {
  flex: 1;
  font-weight: 560;
}
.ut-row[data-state='failed'] .t-tiny {
  color: oklch(var(--tone-ink-l) var(--tone-ink-c) var(--hue-red));
}
.ldrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--scrim);
}
.ldrop[hidden] {
  display: none;
}
.ldrop-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(460px, 100%);
  padding: 36px 28px;
  border-radius: var(--r-5);
  background: var(--surface);
  box-shadow: var(--shadow-pop), inset 0 0 0 2px var(--accent);
  text-align: center;
  pointer-events: none;
}
.ldrop-card .i {
  color: var(--accent);
}
.ldrop-t {
  font-family: var(--font-serif);
  font-size: var(--fs-20);
  font-weight: 450;
  text-wrap: balance;
}

/* ---------------------------------------------------------------- tablets and phones */
@media (max-width: 1279px) {
  .asset-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .asset-tools {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .asset-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'stage' 'notes' 'more';
    gap: 24px;
  }
  .notes {
    position: static;
    max-height: none;
  }
  .notes .note-list {
    overflow: visible;
  }
  .asset-more .section:first-child {
    margin-top: 0;
  }
  .gn-cols {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 1023px) {
  .ib-cols,
  .gn-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .gn-side {
    position: static;
    order: -1;
  }
}
@media (max-width: 720px) {
  .lib-actions {
    width: 100%;
  }
  .lib-tabs {
    flex: 1;
    min-width: 0;
  }
  .lib-tabs a {
    flex: 1 0 auto;
    justify-content: center;
    padding: 0 8px;
  }
  .lib-actions .btn .lbl {
    display: none;
  }
  .lib-actions > .btn {
    width: 36px;
    padding: 0;
  }
  .lib-filters-sp {
    display: none;
  }
  .lib-filters > .chip-row {
    flex: 1 1 100%;
  }
  .lib-filters .search {
    flex: 1 1 0;
  }
  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .acard-body {
    padding: 8px 9px 10px;
    gap: 6px;
  }
  .acard-name {
    font-size: var(--fs-14);
  }
  .acard-top .t-tiny {
    display: none;
  }
  .ib-link {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .asset-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .asset-head > .btn.is-quiet {
    justify-self: start;
    margin-left: -10px;
  }
  .asset-tools {
    justify-content: flex-start;
  }
  .asset-decide {
    flex: 1 1 100%;
  }
  .asset-decide .btn {
    flex: 1;
    height: 40px;
  }
  .stage-bar .btn-row {
    margin-left: 0;
  }
  .tl {
    gap: 6px;
    padding: 6px 8px;
  }
  .tl-time {
    min-width: 0;
    font-size: 11px;
  }
  .tl-note .lbl {
    display: none;
  }
  .thumb {
    width: 112px;
  }
  .version {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .version .status {
    grid-column: 2;
    justify-self: start;
  }
  .cmp-sbs {
    grid-template-columns: minmax(0, 1fr);
  }
  .note {
    padding: 12px 14px;
  }
  .note-composer .hint {
    display: none;
  }
  /* 16 px keeps iOS from zooming into the box on focus */
  .note-composer .composer-input,
  .reply-form .textarea,
  .lib-filters .input {
    font-size: 16px;
  }
  .note-composer .composer-foot .btn.is-accent {
    margin-left: auto;
  }
  .note-composer .composer-foot .composer-extra:not(:empty) + .btn.is-accent {
    margin-left: 4px;
  }
  .utray {
    right: 16px;
    left: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}
/* while Decline's own buttons sit in the foot, the key hint makes room */
.note-composer .composer-foot:has(.composer-extra:not(:empty)) .hint {
  display: none;
}
.note-composer .composer-foot:has(.composer-extra:not(:empty)) .composer-extra {
  margin-left: auto;
}
