:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #64717a;
  --line: #dbe2e7;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --warning: #a16207;
  --shadow: 0 8px 24px rgba(20, 31, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--brand-dark);
}

button.secondary {
  background: #e8eef1;
  color: var(--text);
}

button.secondary:hover {
  background: #dce5ea;
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

label span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.login-panel h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 20;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(20, 31, 38, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

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

.brand strong {
  font-size: 18px;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logout-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  background: transparent;
  color: var(--text);
  text-align: left;
  border: 1px solid transparent;
}

.nav button.active,
.nav button:hover {
  background: #e7f4f2;
  border-color: #b7d9d4;
}

.content {
  min-width: 0;
  padding: 22px;
}

.view {
  display: grid;
  gap: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.publication-link-field {
  min-width: 0;
}

.paste-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.paste-button {
  min-width: 86px;
}

.video-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(17, 24, 28, 0.7);
}

.video-modal {
  width: min(720px, 100%);
  display: grid;
  gap: 10px;
}

.video-modal video {
  width: 100%;
  max-height: 78vh;
  display: block;
  border-radius: 8px;
  background: #000;
  object-fit: contain;
  pointer-events: auto;
}

.video-modal-close {
  justify-self: end;
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

.video-modal-close:hover {
  background: #e8eef1;
}

.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 28, 0.48);
}

.app-dialog {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(23, 32, 38, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(20, 31, 38, 0.24);
}

.app-dialog h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.app-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.app-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.app-dialog-actions button:only-child {
  grid-column: 1 / -1;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.upload-card {
  min-height: 190px;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.upload-card:hover,
.upload-card.has-files {
  border-color: #9fd0ca;
  background: #f2fbf9;
  box-shadow: 0 6px 18px rgba(20, 31, 38, 0.06);
}

.upload-input {
  position: absolute;
  width: 1px;
  min-height: 0;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-card strong {
  font-size: 16px;
}

.upload-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.upload-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 10px;
}

.upload-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.upload-card-action span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.upload-card-action.secondary-action {
  background: #e8eef1;
  color: var(--text);
}

.upload-card-action.secondary-action:hover {
  background: #dce5ea;
}

.upload-choice {
  min-height: 26px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: #eef2f4;
  color: #45545d;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card.has-files .upload-choice {
  background: #dff1ee;
  color: var(--brand-dark);
}

.upload-submit-row {
  display: flex;
  justify-content: flex-start;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

.audio-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.material-modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.material-refresh-button.is-success {
  background: #0f766e;
}

.material-refresh-button.is-error {
  background: var(--danger);
}

.material-kind-switch {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.material-kind-switch:hover {
  background: #f8fafb;
}

.material-kind-switch .is-active {
  color: var(--danger);
}

.kind-separator {
  color: var(--muted);
}

.material-section {
  display: grid;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.material-section.is-collapsed {
  background: #f8fafb;
}

.material-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #c8dedb;
  border-radius: 8px;
  background: #f0faf8;
  padding: 12px 14px;
}

.material-section-toggle {
  width: 100%;
  min-height: 0;
  background: #f0faf8;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.material-section-toggle:hover {
  background: #e4f3f0;
}

.material-section.is-collapsed .material-section-head {
  border-bottom: 1px solid #c8dedb;
  padding-bottom: 12px;
}

.material-section.is-expanded .material-section-head {
  border-color: #9bc9c3;
  background: #e7f5f2;
}

.material-section-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
}

.material-section-head h3::before {
  content: "";
  width: 5px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
}

.duration-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.duration-presets button {
  min-height: 38px;
  padding: 0 10px;
  white-space: nowrap;
}

.duration-presets button.active {
  background: #d5ebe7;
  color: var(--brand-dark);
}

.material-filter {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.folder-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.folder-list > .empty-state,
.folder-group[open] {
  grid-column: 1 / -1;
}

.folder-group {
  display: grid;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.folder-group[open] {
  gap: 14px;
  border-color: #8fc7bf;
  background: #eef9f7;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.08);
}

.folder-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.folder-group[open] .folder-group-head {
  padding: 12px;
  border: 1px solid #b9d9d4;
  border-radius: 8px;
  background: #dff3ef;
}

.folder-group-head::-webkit-details-marker {
  display: none;
}

.folder-title {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.folder-title strong {
  min-width: 0;
  color: #172026;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.folder-group[open] .folder-title strong {
  color: var(--brand-dark);
}

.folder-group[open] .folder-icon {
  background: var(--brand);
}

.folder-group[open] .folder-icon::before {
  background: #49b7ab;
}

.folder-delete {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  flex: 0 0 auto;
}

.folder-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.folder-group[open] .folder-controls {
  padding: 12px;
  border: 1px solid #c7ddda;
  border-radius: 8px;
  background: #dff3ef;
}

.folder-audio-duration {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.audio-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.audio-selection-bar button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.folder-sort-control {
  display: grid;
  gap: 4px;
}

.folder-sort-control span {
  margin: 0;
  font-size: 11px;
}

.folder-sort-control select {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.folder-icon {
  width: 38px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #eab308;
  position: relative;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -7px;
  width: 17px;
  height: 9px;
  border-radius: 5px 5px 0 0;
  background: #facc15;
}

.folder-media-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin-top: 2px;
  padding-top: 18px;
  border-top: 2px solid #8fc7bf;
}

.material-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  min-width: 0;
  position: relative;
}

.material-card.is-selected {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.14);
}

[data-material-kind="audio"] .material-card {
  border-color: #8f9aa3;
  box-shadow: 0 2px 8px rgba(20, 31, 38, 0.08);
}

[data-material-kind="audio"] .material-card.is-selected {
  border-color: var(--danger);
}

.audio-material-select {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid rgba(23, 32, 38, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(20, 31, 38, 0.12);
  cursor: pointer;
}

.audio-material-select input {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  accent-color: var(--danger);
}

.audio-material-select span {
  display: inline;
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.compact-card .preview {
  max-height: 260px;
}

.compact-card .card-body {
  gap: 8px;
  padding: 10px;
}

.compact-card .pill {
  font-size: 12px;
}

.compact-card button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.preview {
  background: #eef2f4;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.video-preview {
  aspect-ratio: 16 / 9;
}

.audio-preview {
  min-height: 74px;
  padding: 12px;
}

.preview video,
.preview img {
  display: block;
  width: 100%;
  height: 100%;
  background: #11181c;
  object-fit: contain;
}

.preview video {
  pointer-events: none;
}

.preview audio {
  width: 100%;
}

.duration-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(17, 24, 28, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.card-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-meta {
  justify-content: flex-start;
}

.media-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.media-actions a,
.media-actions button {
  width: 100%;
}

.media-actions button {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f4;
  color: #34434c;
  font-size: 12px;
}

.pill.warn {
  background: #fff4d6;
  color: var(--warning);
}

.empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

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

.compact-card .actions {
  flex-wrap: nowrap;
}

.table-wrap {
  overflow: auto;
}

.collapsible-panel {
  display: grid;
  gap: 12px;
}

.collapsible-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.collapsible-head::-webkit-details-marker {
  display: none;
}

.collapsible-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.error {
  color: var(--danger);
  min-height: 18px;
}

.notice {
  border-left: 4px solid var(--warning);
  background: #fff8e6;
  padding: 12px;
  border-radius: 6px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.check input {
  width: auto;
  min-height: auto;
}

.upload-progress {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
}

.upload-progress.show {
  display: block;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.progress-row span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-bar {
  height: 10px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5e8;
}

.progress-bar div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 180ms ease;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 176px 1fr;
  }

  .sidebar {
    padding: 12px;
  }

  .content {
    padding: 18px;
  }

  .filters,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    align-content: start;
    grid-auto-rows: max-content;
    min-height: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    position: sticky;
    top: 58px;
    z-index: 4;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px;
    text-align: center;
  }

  .filters,
  .form-grid,
  .upload-grid,
  .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-modules {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    position: static;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand .muted {
    font-size: 12px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .user-area {
    justify-content: space-between;
  }

  .content {
    padding: 12px;
  }

  .view {
    gap: 12px;
  }

  .section-head h2 {
    font-size: 21px;
  }

  .panel,
  .material-section,
  .folder-group {
    padding: 12px;
  }

  .material-section-head h3 {
    font-size: 18px;
  }

  .material-section-head h3::before {
    height: 19px;
  }

  .folder-group-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .folder-title {
    flex: 1 1 100%;
  }

  .folder-title strong {
    font-size: 18px;
  }

  .folder-delete {
    width: 100%;
  }

  .table-wrap table {
    min-width: 640px;
  }
}

@media (max-width: 520px) {
  button,
  input,
  select,
  textarea {
    font-size: 13px;
  }

  button,
  input,
  select {
    min-height: 36px;
  }

  .login-shell {
    padding: 14px;
  }

  .login-panel {
    padding: 18px;
  }

  .login-panel h1 {
    font-size: 23px;
  }

  .topbar {
    position: static;
  }

  .back-to-top {
    right: 12px;
    bottom: 14px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .sidebar {
    top: 0;
  }

  .content {
    padding: 10px;
  }

  .section-head {
    gap: 8px;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .material-kind-switch {
    min-height: 48px;
    font-size: 19px;
  }

  .filters {
    gap: 10px;
  }

  .filters,
  .form-grid,
  .upload-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .paste-row {
    grid-template-columns: 1fr;
  }

  .paste-button {
    width: 100%;
  }

  .upload-card {
    min-height: 160px;
    padding: 14px;
  }

  .upload-action-row {
    grid-template-columns: 1fr;
  }

  .upload-card-action {
    width: 100%;
  }

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

  .duration-presets button,
  .media-actions button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 12px;
  }

  .material-section-head {
    align-items: flex-start;
  }

  .material-section-head h3 {
    font-size: 17px;
  }

  .material-section-head h3::before {
    height: 18px;
  }

  .material-section-head .pill {
    flex: 0 0 auto;
  }

  .folder-title strong {
    font-size: 17px;
  }

  .audio-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .audio-selection-bar button {
    width: 100%;
  }

  .folder-icon {
    width: 32px;
    height: 25px;
  }

  .folder-icon::before {
    width: 15px;
    height: 8px;
  }

  .folder-list {
    gap: 8px;
  }

  .folder-media-grid {
    grid-template-columns: 1fr;
  }

  [data-material-kind="video"] .folder-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  [data-material-kind="video"] .compact-card .preview {
    height: clamp(128px, 38vw, 170px);
    max-height: 170px;
    aspect-ratio: auto !important;
  }

  [data-material-kind="video"] .compact-card .card-body {
    padding: 7px;
  }

  [data-material-kind="video"] .media-actions {
    gap: 5px;
  }

  [data-material-kind="video"] .media-actions button {
    min-height: 30px;
    padding: 0 4px;
    font-size: 11px;
  }

  [data-material-kind="video"] .duration-badge {
    top: 5px;
    right: 5px;
    min-height: 20px;
    padding: 0 6px;
    font-size: 11px;
  }

  .folder-controls {
    grid-template-columns: 1fr;
  }

  .compact-card .preview {
    max-height: none;
  }

  .progress-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
