/* ------------------------------------------------------------------
   Studio: where galleries are made. Quiet, dense enough to work in,
   with the same paper and ink as the client side.
   ------------------------------------------------------------------ */

body.app-admin {
  background: #f6f5f2;
}

.muted {
  color: var(--ink-3);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row.end {
  justify-content: flex-end;
}
.row.split {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 16px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #8f3424;
}
.danger-btn {
  color: var(--danger);
}
.danger-btn:hover {
  background: rgba(168, 64, 46, 0.08);
}

/* ------------------------------------------------------------ login */

.login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, #fff 0%, #f6f5f2 60%);
}
.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 18px;
  text-align: center;
  animation: rise 0.7s var(--ease);
}
.login-card .eyebrow {
  margin: 0;
  color: var(--ink-3);
}
.login-card h1 {
  margin: 0 0 14px;
  font-size: 52px;
}
.login-card .input {
  height: 50px;
  text-align: center;
  font-size: 16px;
  border-radius: 999px;
}
.login-card .btn {
  --h: 50px;
}
.login-error {
  min-height: 1.2em;
  margin: -6px 0 0;
  color: var(--danger);
  font-size: 13px;
}

/* ----------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(246, 245, 242, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}
.brand .display {
  font-size: 28px;
  font-weight: 400;
}
.brand .wordmark {
  color: var(--ink-2);
  font-size: 25px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-title {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}
.topbar-title .eyebrow {
  font-size: 9.5px;
  color: var(--ink-3);
}
.topbar-title strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.save-state {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 6px;
  white-space: nowrap;
}
.save-state.busy {
  color: var(--ink-2);
}

@media (max-width: 640px) {
  .topbar-actions .btn span,
  .brand .wordmark,
  .save-state {
    display: none;
  }
  .topbar-actions .btn {
    padding: 0 12px;
  }
}

/* -------------------------------------------------------- dashboard */

.dash {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 3vw, 32px) 96px;
}
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.dash-head h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 68px);
}
.dash-head p {
  margin: 8px 0 0;
}

.meter {
  width: min(320px, 100%);
  display: grid;
  gap: 10px;
}
.meter-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.meter-label strong {
  font-weight: 600;
}
.meter-label span:first-child {
  color: var(--ink-2);
  margin-right: auto;
}
.meter-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--paper-3);
  overflow: hidden;
}
.meter-bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: inherit;
  transition: width 0.6s var(--ease);
}
.meter-bar i.over {
  background: #b07a2a;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper-3);
  margin-bottom: 24px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.seg button span {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.seg button.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 28px 22px;
}
.card {
  display: block;
  text-decoration: none;
  animation: rise 0.6s var(--ease) both;
}
.card-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper-3);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.card:hover .card-cover img {
  transform: scale(1.035);
}
.card-blank {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.card-blank .icon {
  width: 30px;
  height: 30px;
}
.card-kind {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.card-body {
  padding: 14px 2px 0;
}
.card-body h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.15;
}
.card-body p {
  margin: 4px 0 0;
  font-size: 13px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 11.5px;
  color: var(--ink-2);
}
.chip .icon {
  width: 13px;
  height: 13px;
}

.empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
  padding: 72px 20px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-2);
  background: rgba(255, 255, 255, 0.5);
}
.empty.small {
  padding: 56px 20px;
}
.empty h2 {
  margin: 4px 0 0;
  font-size: 36px;
}
.empty p {
  margin: 0 0 8px;
  max-width: 420px;
  color: var(--ink-2);
}
.empty-art {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.empty-art .icon {
  width: 26px;
  height: 26px;
}

/* ----------------------------------------------------------- editor */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: calc(100svh - 64px);
}
.editor-main {
  position: relative;
  padding: 24px clamp(16px, 3vw, 32px) 120px;
  min-width: 0;
}
.panel {
  border-left: 1px solid var(--line);
  background: var(--card);
  padding: 8px 24px 48px;
  position: sticky;
  top: 64px;
  height: calc(100svh - 64px);
  overflow-y: auto;
}
.panel-group {
  display: grid;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.panel-group:last-child {
  border-bottom: 0;
}
.panel-group h4 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.panel .input {
  height: 40px;
  font-size: 14px;
}
.panel textarea.input {
  height: auto;
}

@media (max-width: 980px) {
  .editor {
    grid-template-columns: 1fr;
  }
  .panel {
    position: static;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.slug {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--card);
  overflow: hidden;
}
.slug:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 22, 21, 0.07);
}
.slug span {
  padding: 0 0 0 12px;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.slug .input {
  border: 0;
  box-shadow: none !important;
  padding-left: 1px;
}
.with-btn {
  display: flex;
  gap: 8px;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}
.toggle-text {
  display: grid;
  gap: 2px;
}
.toggle-text strong {
  font-size: 14px;
  font-weight: 500;
}
.toggle-text small {
  font-size: 12px;
  color: var(--ink-3);
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle i {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 99px;
  background: var(--paper-3);
  transition: background-color 0.25s var(--ease);
}
.toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s var(--ease);
}
.toggle input:checked + i {
  background: var(--ink);
}
.toggle input:checked + i::after {
  transform: translateX(16px);
}
.toggle input:focus-visible + i {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.cover-preview {
  display: grid;
  gap: 8px;
}
.cover-preview img,
.cover-preview .card-blank {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--paper-2);
}
.cover-preview span {
  font-size: 12px;
  color: var(--ink-3);
}

.style-pick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.style-pick button {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 6px 6px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.2s var(--ease);
}
.style-pick button:hover {
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.style-pick button.on {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Miniature covers: <i> is the photograph, <b> the title. */
.style-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
}
.style-thumb i {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #c3ae93, #6b5e4d);
}
.style-thumb b {
  position: absolute;
  z-index: 2;
  left: 32%;
  top: 46%;
  width: 36%;
  height: 3px;
  border-radius: 2px;
  background: #fff;
}
.style-thumb::after {
  content: "";
  position: absolute;
  z-index: 1;
}
.style-thumb.full b {
  top: 66%;
}
.style-thumb.editorial i {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 70%), linear-gradient(135deg, #c3ae93, #6b5e4d);
}
.style-thumb.editorial b {
  left: 12%;
  top: 68%;
  width: 44%;
  height: 4px;
}
.style-thumb.card::after {
  inset: 26% 22%;
  background: var(--paper);
}
.style-thumb.card b,
.style-thumb.stripe b {
  background: var(--ink);
  left: 34%;
  width: 32%;
  top: 48%;
}
.style-thumb.border i {
  background: linear-gradient(135deg, #8d7b66, #4b4135);
}
.style-thumb.border::after {
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.style-thumb.split i {
  inset: 0 50% 0 0;
}
.style-thumb.split b {
  left: 58%;
  width: 32%;
  background: var(--ink);
}
.style-thumb.arch i {
  inset: 14% 12% 14% 56%;
  border-radius: 99px 99px 1px 1px;
}
.style-thumb.arch b {
  left: 12%;
  width: 32%;
  background: var(--ink);
}
.style-thumb.frame i {
  inset: 10% 12% 32%;
}
.style-thumb.frame b {
  top: auto;
  bottom: 13%;
  background: var(--ink);
}
.style-thumb.stripe::after {
  left: 0;
  right: 0;
  top: 36%;
  height: 28%;
  background: var(--paper);
}

.panel-group.danger {
  padding-top: 18px;
}
.panel-group.danger .btn {
  justify-self: start;
  margin-left: -12px;
}

/* ---- sections ---- */

.main-tabs {
  margin-bottom: 20px;
}
.sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.sections:empty {
  display: none;
}
.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 500;
  transition:
    box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}
.section-pill span {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.section-pill:hover {
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.section-pill.on {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}
.section-pill.on span {
  color: rgba(255, 255, 255, 0.6);
}
.section-pill .pill-more {
  width: 16px;
  height: 16px;
  margin-right: -4px;
  opacity: 0.7;
}
.section-pill.add {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-2);
  border: 0;
  color: var(--ink-2);
}
.section-pill.add .icon {
  width: 15px;
  height: 15px;
}
.section-pill.drop {
  box-shadow: inset 0 0 0 2px var(--ink);
  transform: scale(1.04);
}

/* ---- dropzone ---- */

.dropzone {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 56px 24px;
  margin-bottom: 18px;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-2);
  background: rgba(255, 255, 255, 0.55);
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}
.dropzone.compact {
  grid-template-columns: auto 1fr auto;
  justify-items: start;
  text-align: left;
  align-items: center;
  padding: 14px 16px;
  gap: 14px;
}
.drop-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.dropzone.compact .drop-icon {
  width: 40px;
  height: 40px;
}
.drop-copy {
  display: grid;
  gap: 3px;
}
.drop-copy strong {
  font-size: 15px;
  font-weight: 600;
}
.dropzone:not(.compact) .drop-copy strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
}
.drop-copy span {
  font-size: 13px;
}
.drop-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
@media (max-width: 640px) {
  .dropzone.compact {
    grid-template-columns: auto 1fr;
  }
  .dropzone.compact .drop-actions {
    grid-column: 1 / -1;
  }
}

.drop-overlay {
  position: absolute;
  inset: 12px;
  z-index: 20;
  display: none;
  place-items: center;
  border-radius: var(--r-lg);
  border: 2px dashed var(--ink);
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.drop-overlay > div {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  position: sticky;
  top: 40vh;
}
.drop-overlay .icon {
  width: 34px;
  height: 34px;
}
.drop-overlay strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
}
.drop-overlay span {
  color: var(--ink-2);
  font-size: 14px;
}
.editor-main.dragging .drop-overlay {
  display: grid;
}

/* ---- tiles ---- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
@media (max-width: 520px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper-3);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  animation: fade-in 0.4s var(--ease);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.4s var(--ease),
    opacity 0.2s;
}
.tile-file {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.tile-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}
.tile-badge .icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.tile-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(246, 245, 242, 0.6);
}
.tile-check {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.18);
  color: transparent;
  opacity: 0;
  transition:
    opacity 0.2s var(--ease),
    background-color 0.2s var(--ease);
}
.tile-check .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.tile-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.tile-actions .icon-btn {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.tile-actions .icon {
  width: 15px;
  height: 15px;
}
.tile:hover .tile-actions,
.tile:hover .tile-check {
  opacity: 1;
  transform: none;
}
.tile.selected {
  box-shadow: 0 0 0 2.5px var(--ink);
}
.tile.selected img {
  transform: scale(0.9);
  border-radius: 4px;
}
.tile.selected .tile-check {
  opacity: 1;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.tile.is-cover::after {
  content: "Cover";
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@media (hover: none) {
  .tile-check,
  .tile-actions {
    opacity: 1;
    transform: none;
  }
}

/* ---- file list (transfers) ---- */

.file-list {
  display: grid;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.file-list:empty {
  display: none;
}
.file-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--line);
}
.file-row:last-child {
  border-bottom: 0;
}
.file-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--paper-2);
  overflow: hidden;
  color: var(--ink-2);
}
.file-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-name {
  display: grid;
  min-width: 0;
}
.file-name strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-name span {
  font-size: 12px;
}

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

.selbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  transform: translate(-50%, calc(100% + 48px));
  visibility: hidden;
  transition:
    transform 0.4s var(--ease),
    visibility 0s 0.4s;
  white-space: nowrap;
}
.selbar.show {
  transform: translate(-50%, 0);
  visibility: visible;
  transition: transform 0.4s var(--ease);
}
.selbar strong {
  font-size: 13px;
  margin-right: 6px;
}
.move-to {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  font-size: 12px;
}
.move-to:hover {
  background: var(--paper-2);
}
.move-to select {
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
}

/* ---- upload tray ---- */

.tray {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(380px, calc(100vw - 40px));
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(calc(100% + 40px));
  transition: transform 0.45s var(--ease);
}
.tray.show {
  transform: none;
}
.tray-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}
.tray-head div {
  display: grid;
  gap: 2px;
}
.tray-head strong {
  font-size: 14px;
  font-weight: 600;
}
.tray-head span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tray-bar {
  height: 3px;
  background: var(--paper-2);
}
.tray-bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 0.3s linear;
}
.tray-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.tray-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px;
  font-size: 12.5px;
}
.tray-list li.error .tray-name {
  color: var(--danger);
}
.tray-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tray-list .muted {
  font-variant-numeric: tabular-nums;
}
.tray-clear {
  width: 100%;
  padding: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.tray-clear:hover {
  background: var(--paper);
}

/* ---- favourites + activity ---- */

.favs {
  display: grid;
  gap: 14px;
}
.fav-group {
  padding: 18px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.fav-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.fav-head div {
  display: grid;
}
.fav-head strong {
  font-size: 15px;
  font-weight: 600;
}
.fav-head span {
  font-size: 12.5px;
}
.fav-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}
.fav-strip img,
.fav-strip .tile-file {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  background: var(--paper-2);
}

.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.activity li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.activity li:last-child {
  border-bottom: 0;
}
.activity li > span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.activity .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-3);
}
@media (max-width: 560px) {
  .activity li {
    grid-template-columns: 1fr auto;
  }
  .activity li > span:last-child {
    grid-column: 1 / -1;
    margin-top: -12px;
    font-size: 12px;
  }
}

.admin-error {
  min-height: 70svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
}

/* ---- cover focal point ---- */

.focus-pick {
  position: relative;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.focus-pick img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  pointer-events: none;
}
.focus-dot {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 2px 10px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
.focus-dot::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
}
.focus-previews {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.focus-previews figure {
  margin: 0;
  display: grid;
  gap: 4px;
}
.focus-previews img {
  width: 100%;
  object-fit: cover;
  border-radius: 4px;
  background: var(--paper-2);
}
.fp-wide img {
  aspect-ratio: 16 / 9;
}
.fp-tall img {
  width: 54px;
  aspect-ratio: 9 / 16;
}
.focus-previews figcaption {
  font-size: 10.5px;
  color: var(--ink-3);
}
.focus-reset {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- slideshow music ---- */

.music {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.music-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}
.music-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 6px 4px 6px 6px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
}
.music-row > .spinner {
  margin: 0 10px;
}
.music-name {
  display: grid;
  min-width: 0;
}
.music-name strong {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-name span {
  font-size: 11.5px;
}

/* ---- drag to reorder ---- */

.grid-hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--ink-3);
}
.grid-hint:empty {
  display: none;
}
.tile {
  cursor: grab;
}
.tile.dragging,
.file-row.dragging {
  opacity: 0.35;
}
.tile.drop-before {
  box-shadow: -7px 0 0 -2px var(--ink);
}
.tile.drop-after {
  box-shadow: 7px 0 0 -2px var(--ink);
}
.tile.selected.drop-before {
  box-shadow:
    0 0 0 2.5px var(--ink),
    -9px 0 0 -2px var(--ink);
}
.tile.selected.drop-after {
  box-shadow:
    0 0 0 2.5px var(--ink),
    9px 0 0 -2px var(--ink);
}
.file-row {
  cursor: grab;
}
.file-row.drop-before {
  box-shadow: inset 0 2px 0 var(--ink);
}
.file-row.drop-after {
  box-shadow: inset 0 -2px 0 var(--ink);
}

/* ---- section order ---- */

.order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
}
.order:empty {
  display: none;
}
.order-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.order-pick {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper-3);
}
.order-pick button {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.order-pick button.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.order .btn-ghost {
  --h: 32px;
}
.order-note:empty {
  display: none;
}
.order-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---- link preview card ---- */

.share-card {
  display: grid;
  gap: 8px;
}
.share-card img,
.share-blank {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.share-blank {
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.share-card span {
  font-size: 12px;
  color: var(--ink-3);
}

/* ---- duplicate files ---- */

.dup-names {
  margin: -6px 0 18px;
  padding: 12px 14px;
  list-style: none;
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 13px;
  display: grid;
  gap: 4px;
}
.dup-names li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dup-options {
  display: grid;
  gap: 8px;
}
.dup-option {
  display: grid;
  gap: 2px;
  padding: 13px 16px;
  border-radius: var(--r);
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition:
    box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease);
}
.dup-option:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}
.dup-option strong {
  font-size: 14.5px;
  font-weight: 600;
}
.dup-option span {
  font-size: 12.5px;
  color: var(--ink-2);
}
.dup-option.primary {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}
.dup-option.primary span {
  color: rgba(255, 255, 255, 0.72);
}
.dup-option.primary:hover {
  background: #2c2a28;
}

/* ---- music playlist ---- */

.playlist {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.playlist .music-row,
.music-row.uploading {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.music-tools {
  display: flex;
}
.music-tools .icon-btn {
  width: 30px;
  height: 30px;
}
.music-tools .icon-btn .icon {
  width: 16px;
  height: 16px;
}
.music-tools .icon-btn[disabled] {
  opacity: 0.3;
  pointer-events: none;
}
.music-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  cursor: text;
}
.music-title:hover {
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
}
.music-rename {
  height: 30px !important;
  padding: 0 8px;
  font-size: 13px !important;
}
.music-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---- downloads activity ---- */

.activity-wrap {
  display: grid;
  gap: 18px;
}
.act-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.act-stats > div {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.act-stats strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.1;
}
.act-stats span {
  font-size: 12px;
  color: var(--ink-3);
}
.act-top h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.act-top-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}
.act-top-strip figure {
  position: relative;
  margin: 0;
}
.act-top-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--paper-2);
}
.act-top-strip figcaption {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(23, 22, 21, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.activity li {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 10px 16px;
}
.activity li > .act-thumb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
  color: var(--ink-3);
}
.act-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.act-text {
  display: grid;
  min-width: 0;
}
.act-text strong {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act-text span {
  font-size: 12px;
}
.act-when {
  font-size: 12px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .act-stats strong {
    font-size: 22px;
  }
  .activity li {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .activity li > .act-when {
    grid-column: 2;
    margin-top: -6px;
  }
}
