.asset-preview-overlay {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  padding: calc(var(--overlay-padding) * 4);
  place-content: center;
  background: var(--overlay-scrim);
  backdrop-filter: blur(12px);
  animation: overlay-enter 160ms linear both;
}

.asset-preview-shell {
  display: flex;
  width: min(1180px, calc(100vw - 68px));
  height: min(780px, calc(100vh - 68px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--overlay-border);
  border-radius: var(--overlay-radius);
  background: var(--overlay-panel);
  box-shadow: var(--overlay-shadow);
  outline: none;
  animation: dialog-enter 160ms linear both;
}

.asset-preview-shell.asset-image-preview {
  width: 80vw;
  height: 80vh;
}

.asset-preview-shell > header {
  display: flex;
  min-height: 54px;
  padding: 0 var(--overlay-padding) 0 18px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--stroke);
  background: var(--overlay-panel);
}

.asset-preview-shell:not(.asset-audio-preview) > header {
  box-sizing: border-box;
  height: 54px;
  flex: 0 0 54px;
}

.asset-preview-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-preview-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.asset-preview-action-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.asset-preview-zoom-control {
  position: relative;
}

.asset-preview-actions .asset-preview-zoom-popover {
  position: absolute;
  z-index: 8;
  top: calc(100% + 7px);
  left: 0;
  display: grid;
  min-width: 132px;
  padding: 6px;
  gap: 2px;
  border: 1px solid var(--overlay-border);
  border-radius: 10px;
  background: #24262a;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

.asset-preview-actions .asset-preview-zoom-popover[hidden] {
  display: none;
}

.asset-preview-actions .asset-preview-zoom-popover button {
  width: 100%;
  justify-content: flex-start;
}

.asset-preview-actions .asset-preview-zoom-popover button.is-active {
  background: color-mix(in srgb, #688bff 22%, #2b2d31);
  color: #fff;
}

.preview-action-chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-preview-ai-control .toolbar-icon {
  width: 16px;
  height: 16px;
}

.asset-preview-ai-control button:disabled {
  opacity: var(--disabled-opacity, 0.45);
  cursor: not-allowed;
}

.asset-preview-ai-status {
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-muted);
}

.asset-preview-separator {
  width: 1px;
  height: 22px;
  margin: 0 5px;
  background: var(--stroke);
}

.asset-preview-actions button {
  display: inline-flex;
  flex: 0 0 auto;
  height: var(--overlay-control-height);
  padding: 0 11px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.asset-preview-actions button:hover {
  background: var(--interaction-hover);
  color: var(--text);
}

.asset-preview-actions [hidden] {
  display: none !important;
}

.preview-action-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-preview-actions .asset-preview-close {
  width: 34px;
  padding: 0;
  color: #8f939b;
  font-size: 21px;
}

.asset-preview-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(55, 58, 65, 0.26), transparent 48%),
    #111214;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.asset-preview-stage.is-dragging { cursor: grabbing; }

.asset-audio-preview .asset-preview-stage {
  display: flex;
  box-sizing: border-box;
  padding: 48px 36px;
  align-items: center;
  justify-content: center;
  cursor: default;
  touch-action: auto;
}

.asset-audio-preview-player {
  position: relative;
  display: block;
  flex: 0 1 1000px;
  box-sizing: border-box;
  width: min(1000px, 100%);
  max-width: 100%;
  aspect-ratio: 6 / 1;
  padding: 0;
  border: 1px solid #414141;
  border-radius: 24px;
  background: #242424;
}

.asset-preview-shell.asset-audio-preview {
  --node-kind-accent: #d6d6d6;
  width: min(1600px, calc(100vw - 72px));
  height: min(900px, calc(100vh - 72px));
}

.asset-preview-shell.asset-audio-preview > header {
  min-height: 96px;
}

.asset-preview-audio-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 11px;
  row-gap: 3px;
}

.asset-preview-audio-glyph {
  display: grid;
  width: 52px;
  height: 52px;
  grid-row: span 2;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--node-kind-accent) 44%, var(--stroke));
  border-radius: 14px;
  background: color-mix(in srgb, var(--node-kind-accent) 15%, var(--surface-2));
  color: #f5f5f5;
  font-size: 23px;
}

.asset-preview-audio-name {
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-preview-audio-meta {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-audio-preview .asset-preview-actions button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.asset-audio-preview .asset-preview-actions .asset-preview-close {
  width: 42px;
  padding: 0;
  border: 0;
  background: transparent;
}

.asset-preview-shell.is-cropping .asset-preview-stage {
  cursor: default;
}

.asset-preview-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  will-change: transform;
  image-rendering: auto;
  backface-visibility: hidden;
}

.asset-resize-commandbar {
  position: relative;
  display: grid;
  min-height: 96px;
  padding: 10px 14px;
  grid-template-columns: minmax(188px, auto) minmax(0, 1fr) auto auto;
  grid-template-rows: repeat(2, minmax(34px, auto));
  align-items: center;
  gap: 8px 10px;
  border-top: 1px solid var(--stroke);
  background: var(--overlay-panel);
}

.asset-resize-commandbar[hidden] {
  display: none;
}

.asset-free-crop-commandbar {
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  grid-template-rows: 44px;
}

.asset-free-crop-commandbar .asset-resize-summary {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.asset-free-crop-commandbar > [data-action="crop-reset"],
.asset-free-crop-commandbar > [data-action="crop-cancel"],
.asset-free-crop-commandbar > [data-action="crop-confirm"] {
  align-self: stretch;
  height: auto;
  grid-row: 1;
}

.asset-free-crop-commandbar > .asset-crop-ratio-control { grid-column: 2; grid-row: 1; }
.asset-free-crop-commandbar > [data-action="crop-reset"] { grid-column: 3; }
.asset-free-crop-commandbar > [data-action="crop-cancel"] { grid-column: 4; }
.asset-free-crop-commandbar > .asset-resize-confirm[data-action="crop-confirm"] { grid-column: 5; }

.asset-resize-summary {
  display: flex;
  min-width: 188px;
  grid-row: 1 / 3;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.asset-resize-summary strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 680;
}

.asset-resize-summary > span {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.asset-resize-summary .asset-resize-upscale-warning {
  color: #e5a94f;
}

.asset-resize-preset-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.asset-resize-commandbar > [data-role="resize-ratios"] {
  grid-column: 2;
  grid-row: 1;
}

.asset-resize-commandbar > [data-role="resize-sizes"] {
  grid-column: 2;
  grid-row: 2;
}

.asset-resize-commandbar button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #44474d;
  border-radius: 8px;
  background: #2b2d31;
  color: #d7dae0;
  font: 550 12px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
}

.asset-resize-commandbar .asset-resize-preset {
  display: inline-flex;
  min-width: 52px;
  padding: 0 9px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
}

.asset-resize-preset i {
  display: block;
  box-sizing: border-box;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.asset-resize-commandbar .asset-resize-preset.is-active {
  border-color: #688bff;
  background: color-mix(in srgb, #688bff 20%, #2b2d31);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(104, 139, 255, 0.2);
}

.asset-resize-commandbar .asset-resize-confirm {
  grid-column: 4;
  grid-row: 1 / 3;
  align-self: stretch;
  height: auto;
  border-color: #688bff;
  background: #688bff;
  color: #fff;
}

.asset-resize-commandbar > [data-action="resize-cancel"] {
  grid-row: 1 / 3;
  align-self: stretch;
  height: auto;
}

.asset-resize-commandbar > [data-action="resize-cancel"] {
  grid-column: 3;
}

.asset-resize-commandbar button:hover,
.asset-resize-commandbar button:focus-visible {
  border-color: #6f7380;
  color: #fff;
}

.asset-resize-commandbar button:disabled {
  opacity: var(--disabled-opacity);
  pointer-events: none;
}

@media (max-width: 1120px) {
  .asset-resize-commandbar:not(.asset-free-crop-commandbar) {
    overflow-x: auto;
    grid-template-columns: 170px minmax(560px, 1fr) auto auto;
  }
}

.asset-crop-commandbar {
  position: relative;
  display: flex;
  min-height: 52px;
  padding: 8px 14px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--stroke);
  background: var(--overlay-panel);
}

.asset-crop-commandbar[hidden] {
  display: none;
}

.asset-crop-commandbar > span {
  margin-right: auto;
  color: #aeb3bd;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.asset-crop-ratio-control {
  position: relative;
}

.asset-crop-ratio-control > button strong {
  margin-left: 5px;
  color: #fff;
  font-weight: 600;
}

.asset-crop-ratio-popover {
  position: absolute;
  z-index: 12;
  right: 0;
  bottom: 42px;
  display: grid;
  width: 286px;
  padding: 10px;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  border: 1px solid #45484e;
  border-radius: 12px;
  background: #242629;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.asset-crop-ratio-popover[hidden] {
  display: none;
}

:is(.asset-crop-commandbar, .asset-free-crop-commandbar) .asset-crop-ratio-popover button {
  display: grid;
  height: 52px;
  padding: 5px 2px;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-color: #42454b;
  background: #2a2c30;
  color: #aeb2bb;
  font-size: 9px;
}

.asset-crop-ratio-popover button i {
  display: block;
  box-sizing: border-box;
  width: 16px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.asset-crop-ratio-popover button.is-active {
  border-color: #f2f3f5;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

:root[data-theme="light"] .asset-crop-ratio-popover {
  border-color: var(--stroke);
  background: #fff;
  box-shadow: 0 18px 48px rgba(29, 38, 62, 0.18);
}

:root[data-theme="light"] :is(.asset-crop-commandbar, .asset-free-crop-commandbar) .asset-crop-ratio-popover button {
  border-color: var(--stroke);
  background: var(--surface-1);
  color: var(--text-muted);
}

:root[data-theme="light"] .asset-crop-ratio-popover button.is-active {
  border-color: var(--text);
  color: var(--text);
}

.asset-crop-commandbar button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #44474d;
  border-radius: 8px;
  background: #2b2d31;
  color: #d7dae0;
  cursor: pointer;
}

.asset-crop-commandbar .asset-crop-confirm {
  border-color: #688bff;
  background: #688bff;
  color: #fff;
}

.asset-crop-commandbar button:disabled {
  opacity: var(--disabled-opacity);
  pointer-events: none;
}

.asset-crop-surface {
  position: absolute;
  z-index: 5;
  overflow: visible;
  touch-action: none;
  cursor: crosshair;
}

.asset-crop-frame {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid #fff;
  background:
    radial-gradient(circle at 7px 7px, #fff 0 5px, #17181b 5.5px 7px, transparent 7.5px),
    radial-gradient(circle at calc(100% - 7px) 7px, #fff 0 5px, #17181b 5.5px 7px, transparent 7.5px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #fff 0 5px, #17181b 5.5px 7px, transparent 7.5px),
    radial-gradient(circle at 7px calc(100% - 7px), #fff 0 5px, #17181b 5.5px 7px, transparent 7.5px);
  box-shadow: 0 0 0 9999px rgba(7, 8, 10, 0.62);
  cursor: move;
}

.asset-crop-frame::before,
.asset-crop-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.asset-crop-frame::before {
  inset: 33.333% 0;
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.38);
}

.asset-crop-frame::after {
  inset: 0 33.333%;
  border-left: 1px solid rgba(255, 255, 255, 0.38);
  border-right: 1px solid rgba(255, 255, 255, 0.38);
}

.asset-crop-frame button {
  position: absolute;
  z-index: 2;
  width: 15px;
  height: 15px;
  padding: 0;
  border: 2px solid #17181b;
  border-radius: 50%;
  background: #fff;
}

.asset-crop-frame [data-crop-handle="nw"] {
  left: -1px;
  top: -1px;
  cursor: nwse-resize;
}

.asset-crop-frame [data-crop-handle="ne"] {
  right: -1px;
  top: -1px;
  cursor: nesw-resize;
}

.asset-crop-frame [data-crop-handle="se"] {
  right: -1px;
  bottom: -1px;
  cursor: nwse-resize;
}

.asset-crop-frame [data-crop-handle="sw"] {
  left: -1px;
  bottom: -1px;
  cursor: nesw-resize;
}

.asset-preview-video {
  width: min(100%, 1080px);
  max-height: 100%;
  background: #000;
}

.video-preview-shell {
  --video-control-size: 38px;
  display: grid;
  width: 80vw;
  height: 80vh;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--overlay-border) 76%, transparent);
  border-radius: 12px;
  background: #101113;
  box-shadow: var(--overlay-shadow);
  outline: 0;
  animation: dialog-enter 160ms linear both;
}

.video-preview-shell > header {
  display: flex;
  min-width: 0;
  min-height: 58px;
  padding: 0 12px 0 20px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 78%, transparent);
  background: color-mix(in srgb, var(--overlay-panel) 92%, transparent);
}

.video-preview-title {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-preview-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
}

.video-preview-actions button {
  display: inline-grid;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  place-items: center;
  grid-auto-flow: column;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font: 550 13px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
}

.video-preview-actions button:hover,
.video-preview-actions button:focus-visible {
  background: var(--interaction-hover);
  color: var(--text);
}

.video-preview-actions .video-clip-button.is-active {
  background: color-mix(in srgb, #688bff 20%, var(--interaction-hover));
  color: #dbe4ff;
}

.video-preview-actions button:disabled {
  opacity: var(--disabled-opacity);
  pointer-events: none;
}

.video-preview-actions [hidden] {
  display: none !important;
}

.video-preview-actions [data-action="previous-frame"],
.video-preview-actions [data-action="next-frame"] {
  padding: 0;
  font-size: 22px;
}

.video-frame-state {
  min-width: 82px;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.video-preview-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  place-items: center;
  overflow: hidden;
  background: #08090a;
  contain: layout paint;
}

.video-preview-media {
  grid-area: 1 / 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  background: #000;
  object-fit: contain;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.video-preview-buffering {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: inline-flex;
  min-height: 30px;
  padding: 0 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(20, 21, 24, 0.84);
  color: #d9dce3;
  font-size: 12px;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.video-preview-buffering[hidden] { display: none; }

.video-preview-buffering > span {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #688bff;
  border-radius: 50%;
  animation: video-buffer-spin 0.72s linear infinite;
}

@keyframes video-buffer-spin { to { transform: rotate(360deg); } }

.video-preview-proxy {
  visibility: hidden;
  pointer-events: none;
}

.video-preview-stage:is(.is-proxy-scrubbing, .is-proxy-playback) .video-preview-media:not(.video-preview-proxy) {
  visibility: hidden;
}

.video-preview-stage:is(.is-proxy-scrubbing, .is-proxy-playback) .video-preview-proxy[data-layout-ready="true"] {
  visibility: visible;
}

.video-preview-media:not([data-layout-ready="true"]) {
  visibility: hidden;
}

.video-preview-timeline {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 92px;
  padding: 10px 16px 12px;
  flex-direction: column;
  gap: 7px;
  border-top: 1px solid color-mix(in srgb, var(--stroke) 78%, transparent);
  background: color-mix(in srgb, var(--overlay-panel) 92%, transparent);
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.video-preview-seek-row {
  position: relative;
  display: flex;
  min-width: 0;
  height: 28px;
  align-items: center;
}

.video-preview-seek-row input {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: #688bff;
  cursor: ew-resize;
}

.video-preview-cache-rail {
  position: absolute;
  right: 1px;
  bottom: 0;
  left: 1px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--stroke) 70%, transparent);
  pointer-events: none;
}

.video-preview-cache-rail > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #56c98b;
  transition: width 180ms ease;
}

.video-preview-cache-rail[data-state="ready"] > span { width: 100%; }

.video-preview-cache-rail[data-state="working"] > span {
  width: 32%;
  background: #d6aa67;
  animation: video-cache-progress 1.15s ease-in-out infinite alternate;
}

@keyframes video-cache-progress {
  from { transform: translateX(-14%); }
  to { transform: translateX(225%); }
}

.video-preview-control-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 14px;
}

.video-preview-time-group,
.video-preview-audio-group {
  display: flex;
  min-width: 0;
  align-items: center;
}

.video-preview-time-group {
  gap: 5px;
  font-size: 12px;
}

.video-current-time {
  color: var(--text);
  font-weight: 650;
}

.video-playback-status {
  max-width: 140px;
  margin-left: 8px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-playback-status[data-state="ready"] { color: #688bff; }
.video-playback-status[data-state="working"] { color: #d6aa67; }

.video-preview-audio-group {
  justify-content: flex-end;
  gap: 8px;
}

.video-quality-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.video-quality-control .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.video-quality-control select {
  min-width: 72px;
  height: 30px;
  padding: 0 24px 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  outline: none;
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  color-scheme: dark;
  cursor: pointer;
}

.video-quality-control option {
  background: #202226;
  color: #f2f3f5;
}

.video-quality-control select:hover,
.video-quality-control select:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--stroke));
  background: color-mix(in srgb, var(--panel-strong) 96%, var(--accent) 4%);
}

.video-quality-control select:disabled {
  cursor: default;
  opacity: .55;
}

.video-volume-control {
  display: flex;
  flex: 0 1 96px;
  min-width: 64px;
  height: 30px;
  align-items: center;
}

.video-volume-control input {
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  cursor: pointer;
}

.video-volume-control input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--text) var(--volume-progress, 100%), var(--text-muted) var(--volume-progress, 100%));
}

.video-volume-control input::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -3.5px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
}

.video-volume-control input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 28%, transparent);
}

.video-preview-audio-group .video-transport-button {
  flex: 0 0 var(--video-control-size);
}

.video-transport-button {
  display: grid;
  width: var(--video-control-size);
  height: var(--video-control-size);
  padding: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  color: var(--text);
  font: 600 12px/1 var(--font);
  cursor: pointer;
}

.video-play-button {
  border-color: color-mix(in srgb, #688bff 42%, var(--stroke));
  border-radius: 50%;
  background: color-mix(in srgb, #688bff 13%, var(--surface-2));
}

.video-transport-button:hover,
.video-transport-button:focus-visible {
  border-color: color-mix(in srgb, #7b9aff 66%, var(--stroke));
  background: color-mix(in srgb, #7b9aff 16%, var(--surface-2));
}

.video-transport-button .video-fullscreen-icon,
.video-transport-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-transport-icon .video-icon-fill {
  fill: currentColor;
  stroke: none;
}

.video-preview-actions .video-transport-icon {
  width: 16px;
  height: 16px;
}

.video-fps-label {
  padding: 3px 6px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
}

.video-preview-shell.is-clipping {
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
}

.video-clip-panel {
  --clip-accent: #688bff;
  --clip-mark: #ff6269;
  display: grid;
  min-width: 0;
  max-height: 442px;
  overflow: auto;
  border-top: 1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
  background: #17181b;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  scrollbar-gutter: stable;
}

.video-clip-panel[hidden] { display: none; }

.video-clip-panel-header {
  display: flex;
  min-height: 46px;
  padding: 7px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  background: #1d1f23;
}

.video-clip-panel-header > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.video-clip-panel-header strong {
  font-size: 13px;
  font-weight: 680;
}

.video-clip-panel-header span { color: var(--text-muted); }

.video-clip-panel-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.video-clip-panel button {
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #25272c;
  color: var(--text-secondary);
  font: 580 11px/1 var(--font);
  cursor: pointer;
}

.video-clip-panel button:hover,
.video-clip-panel button:focus-visible {
  border-color: color-mix(in srgb, var(--clip-accent) 68%, var(--stroke));
  color: #fff;
}

.video-clip-panel button:disabled {
  cursor: default;
  opacity: var(--disabled-opacity);
}

.video-clip-overview {
  position: relative;
  height: 44px;
  padding: 9px 15px;
  outline: 0;
  touch-action: none;
  user-select: none;
}

.video-clip-overview:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--clip-accent) 76%, transparent);
}

.video-clip-overview-track {
  position: relative;
  height: 24px;
  overflow: visible;
  border: 1px solid #3b3e45;
  border-radius: 7px;
  background:
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.035) 39px 40px),
    #23252a;
}

.video-clip-selection-fill {
  position: absolute;
  top: 0;
  right: calc(100% - var(--clip-end, 100%));
  bottom: 0;
  left: var(--clip-start, 0%);
  background: color-mix(in srgb, var(--clip-accent) 30%, transparent);
  pointer-events: none;
}

.video-clip-selection-fill {
  border-right: 1px solid color-mix(in srgb, var(--clip-accent) 80%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--clip-accent) 80%, transparent);
}

.video-clip-playhead {
  position: absolute;
  z-index: 5;
  top: 3px;
  bottom: 3px;
  left: var(--clip-position, 0%);
  width: 2px;
  border-radius: 999px;
  background: #688bff;
  box-shadow: 0 0 0 1px rgba(24, 26, 31, .7);
  pointer-events: none;
  transform: translateX(-1px);
}

.video-clip-handle {
  position: absolute;
  z-index: 6;
  top: -5px;
  left: var(--clip-position, 0%);
  width: 15px;
  height: 34px !important;
  padding: 0 !important;
  border-color: color-mix(in srgb, var(--clip-mark) 82%, #fff 8%) !important;
  border-radius: 5px !important;
  background: #3a252a !important;
  cursor: ew-resize !important;
  transform: translateX(-50%);
}

.video-clip-handle i {
  display: block;
  width: 2px;
  height: 18px;
  margin: auto;
  border-radius: 999px;
  background: var(--clip-mark);
}

.video-clip-boundaries {
  display: grid;
  min-width: 0;
  padding: 0 14px 10px;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, .52fr) minmax(260px, 1fr);
  align-items: stretch;
  gap: 9px;
}

.video-clip-boundary-card {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
  border-radius: 9px;
  background: #202226;
}

.video-clip-boundary-card {
  display: grid;
  padding: 8px;
  grid-template-columns: 70px minmax(95px, 1fr) minmax(76px, .55fr);
  grid-template-rows: auto auto auto;
  gap: 6px 8px;
}

.video-clip-boundary-heading {
  display: flex;
  grid-column: 2 / 4;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.video-clip-boundary-heading strong { font-size: 11px; }
.video-clip-boundary-heading span { color: var(--text-muted); }

.video-clip-boundary-card label {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.video-clip-boundary-card input {
  box-sizing: border-box;
  width: 100%;
  height: 27px;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid #3b3e45;
  border-radius: 6px;
  outline: 0;
  background: #16171a;
  color: var(--text);
  font: 560 10px/1 var(--font);
  font-variant-numeric: tabular-nums;
}

.video-clip-boundary-card input:focus {
  border-color: color-mix(in srgb, var(--clip-accent) 76%, #3b3e45);
}

.video-clip-nudges {
  display: grid;
  grid-column: 2 / 4;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.video-clip-nudges button {
  height: 26px;
  padding: 0;
  font-size: 10px;
  touch-action: none;
  user-select: none;
}

.video-clip-nudges button.is-holding {
  border-color: color-mix(in srgb, var(--clip-accent) 72%, #fff 8%);
  background: color-mix(in srgb, var(--clip-accent) 18%, #25272c);
  color: #fff;
  transform: translateY(1px);
}

.video-clip-progress {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 10px;
  color: var(--text-muted);
}

.video-clip-progress strong { color: var(--text-secondary); }

.video-clip-progress > i {
  display: block;
  height: 3px;
  grid-column: 1 / 3;
  overflow: hidden;
  border-radius: 999px;
  background: #34373d;
}

.video-clip-progress > i > b {
  display: block;
  width: var(--clip-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #688bff, #688bff);
  transition: width 120ms linear;
}

/* The clipper defaults to one compact decision path. Exact controls stay available on demand. */
.video-clip-panel {
  max-height: min(420px, 48vh);
  overflow-x: hidden;
}

.video-clip-panel.is-advanced {
  max-height: min(500px, 60vh);
}

.video-clip-overview {
  height: 54px;
  padding: 14px 18px 8px;
}

.video-clip-overview-track {
  height: 28px;
  border-radius: 8px;
}

.video-clip-handle {
  top: -5px;
  height: 38px !important;
}

.video-clip-primary-controls {
  display: grid;
  min-height: 56px;
  padding: 8px 18px 12px;
  grid-template-columns: auto 38px auto minmax(145px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.video-clip-primary-controls kbd {
  margin-left: 4px;
  color: var(--text-muted);
  font: 500 9px/1 var(--font);
}

.video-clip-panel .video-clip-play-selection {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
}

.video-clip-primary-duration {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
  color: var(--text-muted);
}

.video-clip-primary-duration strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-clip-primary-controls .video-clip-export {
  height: 38px;
  padding: 0 18px;
  border-color: #688bff;
  background: #688bff;
  color: #fff;
  font-weight: 650;
}

.video-clip-progress {
  position: relative;
  min-height: 42px;
  padding: 7px 18px 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  border-top: 1px solid color-mix(in srgb, var(--stroke) 60%, transparent);
  background: #1b1d21;
}

.video-clip-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 0 18px 10px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.video-clip-mode-row label { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.video-clip-mode-row select {
  max-width: 100%;
  min-height: 32px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 4px 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.video-clip-mode-row p { flex: 1 1 280px; min-width: 0; margin: 0; line-height: 1.5; overflow-wrap: anywhere; }

.video-clip-progress[hidden],
.video-clip-advanced[hidden] {
  display: none;
}

.video-clip-progress > i { grid-column: 1 / 3; }
.video-clip-progress .video-clip-cancel {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
}

.video-clip-advanced {
  border-top: 1px solid color-mix(in srgb, var(--stroke) 76%, transparent);
  background: #191a1e;
}

.video-clip-advanced .video-clip-boundaries {
  padding: 12px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-clip-advanced .video-clip-boundary-card {
  padding: 10px;
  grid-template-columns: minmax(0, 1.35fr) minmax(74px, .65fr);
  grid-template-rows: auto auto auto;
  gap: 7px 8px;
}

.video-clip-advanced .video-clip-boundary-heading {
  grid-column: 1 / 3;
}

.video-clip-advanced .video-clip-nudges {
  grid-column: 1 / 3;
}

@media (max-width: 980px) {
  .video-clip-panel { max-height: min(470px, 55vh); }
  .video-clip-panel-header > div:first-child span { display: none; }
  .video-clip-primary-controls {
    grid-template-columns: auto 38px auto minmax(120px, 1fr) auto;
  }
  .video-clip-primary-controls > [data-action="clip-toggle-advanced"] { grid-column: 5; }
  .video-clip-primary-controls .video-clip-export { grid-column: 1 / 6; }
}

@media (max-width: 720px) {
  .video-preview-shell.is-clipping { grid-template-rows: auto minmax(140px, 1fr) auto auto; }
  .video-clip-primary-controls {
    grid-template-columns: auto 36px auto 1fr;
  }
  .video-clip-primary-duration { grid-column: 4; }
  .video-clip-primary-controls > [data-action="clip-toggle-advanced"] { grid-column: 1 / 3; }
  .video-clip-primary-controls .video-clip-export { grid-column: 3 / 5; }
}

@media (max-width: 560px) {
  .video-clip-advanced .video-clip-boundaries { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .video-preview-actions .asset-preview-action-group[aria-label] {
    gap: 0;
  }

  .video-preview-actions button {
    min-width: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .video-preview-control-row {
    grid-template-columns: var(--video-control-size) minmax(0, 1fr);
    gap: 8px;
  }

  .video-preview-time-group { grid-column: 1 / -1; }

  .video-fps-label {
    display: none;
  }

  .video-playback-status { display: none; }
}

:root[data-theme="light"] .video-preview-shell,
:root[data-theme="light"] .video-preview-stage {
  background: #e9ecf2;
}

.asset-preview-file-card {
  display: flex;
  width: 360px;
  min-height: 230px;
  padding: 32px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid #3f4146;
  border-radius: 13px;
  background: #25262a;
}

.asset-preview-file-card > div {
  display: grid;
  width: 70px;
  height: 78px;
  margin-bottom: 20px;
  place-content: center;
  border: 1px solid #52658a;
  border-radius: 8px;
  background: #30466f;
  color: #e5ebf8;
  font-size: 24px;
  font-weight: 700;
}

.asset-preview-file-card strong {
  max-width: 100%;
  overflow: hidden;
  color: #e8eaee;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-preview-file-card span {
  margin-top: 8px;
  color: #858a93;
  font-size: 11px;
}

.document-preview-view {
  position: absolute;
  inset: 0;
  display: block;
  overflow: auto;
  padding: 28px clamp(20px, 4vw, 64px);
  background: #151618;
  color: var(--text);
  cursor: default;
  touch-action: pan-x pan-y;
  user-select: text;
}

.document-preview-view[data-preview-kind="pdf"] {
  padding: 14px;
  overflow: hidden;
}

.document-preview-view[data-preview-kind="fallback"] {
  display: grid;
  place-content: center;
}

.document-preview-text {
  width: min(1120px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 52px);
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: var(--surface-0);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  color: var(--text);
  font: 15px/1.8 "Cascadia Mono", "Noto Sans SC", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.document-preview-word {
  width: min(920px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 72px);
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: var(--surface-0);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
}

.document-preview-word h1,
.document-preview-word h2,
.document-preview-word h3,
.document-preview-word h4,
.document-preview-word h5,
.document-preview-word h6 {
  margin: 1.25em 0 0.55em;
  line-height: 1.3;
}

.document-preview-word h1:first-child,
.document-preview-word h2:first-child {
  margin-top: 0;
}

.document-preview-word p { margin: 0 0 0.85em; }
.document-preview-word li { margin: 0.2em 0; }
.document-preview-word pre {
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--stroke-soft);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-secondary);
  font: 13px/1.65 "Cascadia Mono", monospace;
  white-space: pre-wrap;
}

.document-preview-slides {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 22px;
}

.document-preview-slide {
  position: relative;
  min-height: 230px;
  padding: 38px 42px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: linear-gradient(145deg, #24262b, #191a1d);
  box-shadow: 0 15px 42px rgba(0, 0, 0, 0.24);
}

.document-preview-slide h2 {
  max-width: calc(100% - 40px);
  margin: 0 0 22px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.3;
}

.document-preview-slide ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.document-preview-slide-number {
  position: absolute;
  top: 18px;
  right: 20px;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.document-preview-pdf {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #dfe2e7;
}

.document-preview-fallback,
.document-preview-loading {
  display: grid;
  width: min(420px, calc(100% - 40px));
  min-height: 220px;
  padding: 34px;
  place-content: center;
  justify-items: center;
  gap: 14px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface-0);
  color: var(--text-secondary);
  text-align: center;
}

.document-preview-fallback span {
  display: grid;
  width: 48px;
  height: 48px;
  place-content: center;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text);
  font-size: 23px;
}

.document-preview-fallback p,
.document-preview-loading p { margin: 0; line-height: 1.65; }

.document-preview-loading > span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--stroke);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: document-preview-spin 800ms linear infinite;
}

@keyframes document-preview-spin { to { transform: rotate(360deg); } }

.asset-preview-shell > footer {
  display: flex;
  min-height: 42px;
  padding: 0 18px;
  align-items: center;
  border-top: 1px solid var(--stroke);
  background: var(--overlay-panel);
  color: var(--text-muted);
  font-size: 11px;
}

:root[data-theme="light"] .asset-preview-stage {
  background:
    radial-gradient(circle at 50% 45%, rgba(112, 120, 140, 0.14), transparent 48%),
    #e9ecf2;
}

:root[data-theme="light"] .asset-preview-file-card {
  border-color: var(--stroke);
  background: var(--surface-0);
}

:root[data-theme="light"] .asset-preview-file-card strong {
  color: var(--text);
}

:root[data-theme="light"] .document-preview-view {
  background: #f1f2f4;
}

:root[data-theme="light"] .document-preview-slide {
  background: linear-gradient(145deg, #ffffff, #f2f4f8);
  box-shadow: 0 14px 36px rgba(43, 49, 63, 0.12);
}

.folder-preview-shell {
  display: grid;
  width: min(1420px, calc(100vw - 48px));
  height: min(900px, calc(100vh - 48px));
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--overlay-border) 82%, transparent);
  border-radius: 14px;
  background: #151619;
  box-shadow: var(--overlay-shadow);
  outline: 0;
  animation: dialog-enter 160ms linear both;
}

.folder-preview-header {
  display: flex;
  min-height: 62px;
  padding: 0 14px 0 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
  background: color-mix(in srgb, var(--overlay-panel) 94%, transparent);
}

.folder-preview-heading {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.folder-preview-heading strong,
.folder-preview-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-preview-heading strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 670;
}

.folder-preview-heading span {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.folder-preview-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
}

.folder-preview-actions button {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font: 550 12px/1 var(--font);
  cursor: pointer;
}

.folder-preview-actions button:hover,
.folder-preview-actions button:focus-visible {
  background: var(--interaction-hover);
  color: var(--text);
}

.folder-preview-actions .asset-preview-close {
  width: 34px;
  padding: 0;
  color: var(--text-muted);
  font-size: 20px;
}

.folder-preview-toolbar {
  display: flex;
  min-height: 58px;
  padding: 10px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 68%, transparent);
  background: color-mix(in srgb, var(--surface-1) 86%, #151619);
}

.folder-preview-filters {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.folder-preview-filters button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: 560 12px/1 var(--font);
  cursor: pointer;
}

.folder-preview-filters button:hover {
  color: var(--text);
  background: var(--interaction-hover);
}

.folder-preview-filters button.is-active {
  border-color: color-mix(in srgb, #688bff 38%, var(--stroke));
  background: color-mix(in srgb, #688bff 16%, var(--surface-2));
  color: #aebfff;
}

.folder-preview-search {
  display: flex;
  width: min(360px, 38vw);
  height: 36px;
  min-width: 180px;
  padding: 0 11px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-0) 82%, transparent);
  color: var(--text-muted);
}

.folder-preview-search:focus-within {
  border-color: color-mix(in srgb, #688bff 65%, var(--stroke));
  box-shadow: 0 0 0 3px color-mix(in srgb, #688bff 12%, transparent);
}

.folder-preview-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.folder-preview-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 12px/1 var(--font);
}

.folder-preview-content {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  scrollbar-gutter: stable;
  background:
    radial-gradient(circle at 50% 0, rgba(62, 67, 78, 0.16), transparent 42%),
    #111214;
}

.folder-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  align-items: start;
  gap: 16px;
}

.folder-preview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--stroke) 78%, transparent);
  border-radius: 11px;
  background: #1c1d21;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  outline: 0;
  transition: border-color var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast);
}

.folder-preview-card:hover,
.folder-preview-card:focus-visible {
  border-color: color-mix(in srgb, #7b9aff 58%, var(--stroke));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.folder-preview-card-media {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  background: #08090a;
}

.folder-preview-card-media img,
.folder-preview-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #08090a;
}

.folder-preview-card-media img {
  opacity: 0;
  transition: opacity var(--motion-fast);
}

.folder-preview-card.is-media-ready .folder-preview-card-media img {
  opacity: 1;
}

.folder-preview-card-video {
  opacity: 0;
  transition: opacity var(--motion-fast);
}

.folder-preview-card.is-media-ready .folder-preview-card-video {
  opacity: 1;
}

.folder-preview-card-fallback {
  color: #656a75;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.folder-preview-card.is-media-loading .folder-preview-card-fallback::after {
  display: block;
  width: 54px;
  height: 2px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #688bff, transparent);
  content: '';
  animation: folder-preview-loading 1.1s ease-in-out infinite;
}

.folder-preview-card.is-media-failed .folder-preview-card-fallback::after {
  display: block;
  margin-top: 8px;
  color: #8e929c;
  content: '可使用内置播放器或系统应用打开';
  font-size: 9px;
  font-weight: 450;
  letter-spacing: 0;
}

@keyframes folder-preview-loading {
  0%, 100% { opacity: 0.25; transform: scaleX(0.45); }
  50% { opacity: 1; transform: scaleX(1); }
}

.folder-preview-card-action {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(22, 23, 26, 0.78);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity var(--motion-fast), transform var(--motion-fast), background var(--motion-fast);
}

.folder-preview-card:hover .folder-preview-card-action,
.folder-preview-card:focus-within .folder-preview-card-action,
.folder-preview-card-action:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.folder-preview-card-action:hover {
  background: color-mix(in srgb, #7b9aff 72%, #202228);
}

.folder-preview-card-action svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.folder-preview-card-body {
  display: grid;
  min-width: 0;
  padding: 11px 12px 12px;
  gap: 5px;
}

.folder-preview-card-body strong,
.folder-preview-card-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-preview-card-body strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
}

.folder-preview-card-body span {
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.folder-preview-empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  gap: 8px;
  color: var(--text-secondary);
  text-align: center;
}

.folder-preview-empty[hidden] { display: none; }
.folder-preview-empty small { color: var(--text-muted); }

.folder-preview-load-more {
  display: block;
  min-width: 140px;
  height: 36px;
  margin: 18px auto 2px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
}

.folder-preview-load-more[hidden] { display: none; }

.folder-preview-footer {
  display: flex;
  min-height: 40px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid color-mix(in srgb, var(--stroke) 76%, transparent);
  background: color-mix(in srgb, var(--overlay-panel) 94%, transparent);
  color: var(--text-muted);
  font-size: 10px;
}

:root[data-theme="light"] .folder-preview-shell {
  background: #f7f8fa;
}

:root[data-theme="light"] .folder-preview-content {
  background:
    radial-gradient(circle at 50% 0, rgba(88, 103, 138, 0.07), transparent 42%),
    #f3f4f6;
}

:root[data-theme="light"] .folder-preview-card {
  background: #fff;
  box-shadow: 0 7px 18px rgba(45, 52, 66, 0.07);
}

@media (max-width: 760px) {
  .folder-preview-shell {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }
  .folder-preview-header { padding-left: 14px; }
  .folder-preview-actions button:not(.asset-preview-close) { display: none; }
  .folder-preview-toolbar { align-items: stretch; flex-direction: column; }
  .folder-preview-search { width: 100%; }
  .folder-preview-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .folder-preview-footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .asset-preview-overlay,
  .asset-preview-shell,
  .folder-preview-shell {
    animation: none !important;
  }

  .document-preview-loading > span { animation: none !important; }
}

.archive-preview-overlay { background: color-mix(in srgb, var(--canvas-bg, #111214) 68%, transparent); }
.archive-preview-shell {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(1100px, calc(100vw - 96px)); height: min(var(--archive-browser-height, 460px), 80vh);
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden;
  border: 1px solid var(--stroke-strong); border-radius: 16px; background: var(--surface-1);
  box-shadow: 0 24px 80px #0006; color: var(--text); font-size: 13px; outline: none;
}
.archive-preview-shell [hidden] { display: none !important; }
.archive-preview-shell > header, .archive-preview-shell > nav, .archive-preview-shell > footer {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--stroke);
}
.archive-preview-shell:has(.archive-password-panel:not([hidden])) > header { position: relative; z-index: 7; background: var(--surface-1); }
.archive-heading { display: grid; gap: 4px; flex: 1; min-width: 0; }
.archive-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.archive-heading span { color: var(--text-muted); font-size: 12px; }
.archive-preview-shell button { min-height: 32px; padding: 5px 10px; flex-shrink: 0; border: 1px solid var(--stroke); border-radius: 7px; background: var(--surface-2); color: var(--text-secondary); font: inherit; cursor: pointer; }
.archive-preview-shell button:hover { background: var(--surface-3, var(--surface-2)); color: var(--text); }
.archive-preview-shell button:disabled { opacity: .45; cursor: default; }
.archive-preview-shell button:focus-visible, .archive-preview-shell input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.archive-preview-shell > header [data-action="close"] { border-color: transparent; background: transparent; width: 34px; padding: 0; font-size: 23px; }
.archive-preview-shell > nav { flex-wrap: wrap; gap: 10px 16px; }
.archive-path-group, .archive-search-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.archive-path-group { flex: 1 1 260px; }
.archive-path-group span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.archive-search-group { flex: 1 1 310px; }
.archive-search-group input { width: 0; min-width: 80px; flex: 1; }
.archive-preview-shell input { box-sizing: border-box; height: 34px; padding: 0 10px; border: 1px solid var(--stroke); border-radius: 7px; background: var(--surface-0); color: var(--text); font: inherit; color-scheme: dark; }
:root[data-theme="light"] .archive-preview-shell input { color-scheme: light; }
.archive-preview-shell .archive-filter-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 34px; min-width: 102px; background: var(--surface-0); color: var(--text); }
.archive-filter-trigger > [aria-hidden="true"] { width: 6px; height: 6px; margin: -3px 2px 0; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); font-size: 0; }
.archive-filter-trigger[data-input="pointer"]:focus { outline: none; }
.archive-preview-shell .archive-filter-menu { position: absolute; z-index: 4; box-sizing: border-box; width: 164px; max-width: calc(100% - 16px); padding: 6px; overflow-y: auto; border: 1px solid var(--stroke-strong); border-radius: 10px; background: var(--surface-1); box-shadow: 0 8px 24px #0004; }
.archive-preview-shell .archive-filter-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; border: 0; background: transparent; text-align: left; color: var(--text); }
.archive-preview-shell .archive-filter-menu button:hover, .archive-preview-shell .archive-filter-menu button[aria-selected="true"] { background: var(--surface-2); }
.archive-preview-shell .archive-filter-menu button:focus-visible { outline-offset: -2px; }
.archive-preview-shell > footer { padding: 11px 18px; border-top: 1px solid var(--stroke); border-bottom: 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.archive-browser-content { min-height: 0; display: flex; flex-direction: column; background: var(--surface-0); overflow: hidden; }
.archive-directory-status { flex-shrink: 0; padding: 16px 18px 4px; color: var(--text-muted); }
.archive-browser-content > [data-action="retry-directory"] { align-self: flex-start; margin: 8px 18px; }
.archive-entry-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 164px), 1fr)); grid-auto-rows: max-content; align-content: start; align-items: start; gap: 14px; overflow: auto; padding: 18px; scrollbar-gutter: stable; }
.archive-entry-grid[aria-busy="true"] { opacity: .55; }
.archive-entry-card { position: relative; width: 100%; max-width: 220px; min-width: 0; box-sizing: border-box; overflow: hidden; border: 1px solid var(--stroke); border-radius: 10px; background: var(--surface-1); cursor: grab; user-select: none; }
.archive-entry-card:hover { border-color: color-mix(in srgb, var(--accent) 65%, var(--stroke)); }
.archive-entry-card:active { cursor: grabbing; }
.archive-card-media { position: relative; display: grid; aspect-ratio: 16/10; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--text-muted); font-size: 30px; }
.archive-card-media img, .archive-card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.archive-card-meta { display: grid; gap: 5px; padding: 10px; }
.archive-card-meta strong { min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 13px; font-weight: 500; line-height: 18px; }
.archive-card-meta small { color: var(--text-muted); font-size: 11px; }
.archive-entry-card > [data-action="preview-entry"] { position: absolute; top: 7px; right: 7px; min-height: 27px; padding: 3px 7px; opacity: 0; background: color-mix(in srgb, var(--surface-1) 92%, transparent); }
.archive-entry-card:hover > [data-action="preview-entry"], .archive-entry-card:focus-within > [data-action="preview-entry"] { opacity: 1; }
.archive-card-status { display: flex; align-items: center; gap: 6px; height: 31px; padding: 0 10px 8px; overflow: hidden; white-space: nowrap; color: var(--text-muted); font-size: 11px; line-height: 17px; }
.archive-card-status > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.archive-card-status button { min-height: 23px; padding: 0 6px; font-size: 11px; }
.archive-video-play { position: absolute; bottom: 8px; left: 8px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #0009; color: white; font-size: 12px; }
.archive-audio-glyph { z-index: 1; }
.archive-audio-wave { position: absolute; inset: 25% 12%; opacity: .3; background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 6px); mask-image: linear-gradient(to bottom, transparent, #000 38%, #000 62%, transparent); }
.archive-load-more { align-self: center; margin: 0 0 12px; }
.archive-preview-shell [data-action="unlock-archive"] { align-self: center; margin: 0 18px 12px; }
.archive-password-panel { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 18px; overflow: auto; background: color-mix(in srgb, var(--surface-0) 80%, transparent); }
.archive-password-form { width: min(360px, 100%); box-sizing: border-box; padding: 22px; border: 1px solid var(--stroke-strong); border-radius: 12px; background: var(--surface-1); box-shadow: 0 12px 36px #0003; }
.archive-password-form > strong { font-size: 16px; }
.archive-password-form p { margin: 10px 0 18px; color: var(--text-muted); line-height: 1.5; }
.archive-password-form label { display: grid; gap: 8px; color: var(--text-secondary); }
.archive-password-field { display: flex; gap: 8px; }
.archive-password-field input { width: 0; flex: 1; min-width: 0; }
.archive-password-form [data-role="password-error"] { min-height: 20px; margin: 10px 0; color: var(--danger, #d46464); }
.archive-password-actions { display: flex; justify-content: flex-end; gap: 8px; }
.archive-password-actions [data-action="submit-password"] { border-color: var(--accent); color: var(--text); }
.archive-media-viewer { position: absolute; inset: 0; z-index: 5; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 18px; background: var(--surface-0); }
.archive-media-viewer > [data-action="close-media"] { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; font-size: 22px; }
.archive-media-viewer > [data-role="media-title"] { padding: 0 52px 14px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-media-viewer > [data-role="media-body"] { display: grid; min-height: 0; place-items: center; overflow: auto; color: var(--text-secondary); }
.archive-media-viewer img, .archive-media-viewer video { max-width: 100%; max-height: 100%; object-fit: contain; }
.archive-media-viewer audio { width: min(720px, 90%); }
.archive-media-viewer iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.archive-media-viewer pre { max-width: 100%; max-height: 100%; margin: 0; padding: 20px; overflow: auto; white-space: pre-wrap; }
.archive-media-error { display: grid; justify-items: center; gap: 14px; padding: 16px; }
@media (max-width: 700px) {
  .archive-preview-shell { width: calc(100vw - 40px); }
  .archive-preview-shell > header, .archive-preview-shell > nav { padding: 10px 12px; }
  .archive-search-group, .archive-path-group { flex-basis: 100%; }
  .archive-entry-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); padding: 12px; gap: 10px; }
}
.asset-image-preview > footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.image-preview-fullscreen { display:grid; place-items:center; flex:none; width:30px; height:28px; padding:5px; border:0; border-radius:5px; background:transparent; color:var(--text-secondary); cursor:pointer; }
.image-preview-fullscreen:hover,.image-preview-fullscreen:focus-visible { background:var(--surface-2); color:var(--text); }
.image-preview-fullscreen svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.5; }
.asset-preview-shell.asset-image-preview:fullscreen,.asset-preview-shell.asset-image-preview.is-image-fullscreen { position:fixed; inset:0; width:100vw; height:100vh; max-width:none; max-height:none; border:0; border-radius:0; box-sizing:border-box; animation:none; }
