* {
  box-sizing: border-box;
}

:root {
  --bg: #151515;
  --surface: #202124;
  --surface-2: #292b2e;
  --surface-3: #33363a;
  --line: #3d4146;
  --text: #f3f4f2;
  --muted: #a8aca7;
  --subtle: #747a73;
  --accent: #18a999;
  --accent-2: #f2b84b;
  --danger: #e45b5b;
  --good: #69c37d;
  --shadow: rgba(0, 0, 0, 0.32);
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 8, 9, 0.82);
}

.login-overlay.is-hidden {
  display: none;
}

.login-panel {
  width: min(100%, 380px);
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 60px var(--shadow);
}

.login-icon {
  width: 42px;
  height: 42px;
}

.login-panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.login-panel p[data-type="error"] {
  color: var(--danger);
}

.login-panel p[data-type="warning"] {
  color: var(--accent-2);
}

.login-panel input {
  height: 42px;
  min-width: 0;
  padding: 0 13px;
  color: var(--text);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.login-panel input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 169, 153, 0.18);
}

.login-panel button {
  height: 42px;
  border-radius: 6px;
  color: #08110f;
  background: var(--accent);
  font-weight: 650;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-rows: 68px 1fr 34px;
  height: 100%;
  min-width: 320px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(190px, 300px) minmax(280px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px clamp(12px, 2vw, 18px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.magnet-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 96px 72px 72px 72px;
  gap: 10px;
}

.magnet-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  color: var(--text);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.magnet-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 169, 153, 0.18);
}

.magnet-form button,
.actions button {
  height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  color: #08110f;
  background: var(--accent);
  font-weight: 650;
  cursor: pointer;
}

#logoutButton {
  color: var(--text);
  background: var(--surface-3);
}

.magnet-form button:disabled,
.actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.workspace {
  display: grid;
  grid-template-columns: clamp(360px, 34vw, 520px) minmax(0, 1fr);
  min-height: 0;
}

.queue {
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-rows: 47px 1fr;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.panel-title strong {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  text-align: center;
}

.panel-title.compact {
  height: 34px;
  padding: 0;
  border-bottom: 0;
}

.task-list {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.empty-list {
  padding: 18px 12px;
  color: var(--subtle);
  text-align: center;
}

.task-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 76px 14px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px 10px;
  margin-bottom: 6px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.task-files {
  display: grid;
  gap: 6px;
  margin: -2px 0 10px;
  padding: 0 8px 0 28px;
}

.task-item:hover,
.task-item.active {
  background: var(--surface-2);
  border-color: var(--line);
}

.task-item.active {
  border-color: var(--accent);
}

.task-toggle {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid var(--muted);
  transition: transform 160ms ease;
}

.task-item.expanded .task-toggle {
  transform: rotate(90deg);
  border-left-color: var(--accent);
}

.task-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
}

.task-status.ready {
  background: var(--good);
}

.task-main,
.task-side,
.file-item span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.task-main strong,
.file-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-main span,
.task-side span,
.file-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-side {
  text-align: right;
}

.task-side strong {
  color: var(--accent);
  font-size: 12px;
}

.stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  background: var(--bg);
}

.player-wrap {
  position: relative;
  min-height: 0;
  background: #050505;
  box-shadow: inset 0 -1px 0 var(--line);
}

.player-wrap video {
  width: 100%;
  height: 100%;
  display: none;
  background: #050505;
  object-fit: contain;
}

.player-wrap video.is-active {
  display: block;
}

.player-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.player-state.is-hidden {
  display: none;
}

.state-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.player-state strong {
  font-size: 18px;
  font-weight: 650;
}

.seek-panel {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: #101112;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.seek-panel.is-hidden {
  display: none;
}

.seek-panel input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

#seekCurrent {
  color: var(--text);
}

#seekDuration {
  text-align: right;
}

.details {
  min-height: 0;
  max-height: 38vh;
  overflow: auto;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.details-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.details h2 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.details p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--subtle);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.actions button {
  height: 34px;
  min-width: 62px;
  color: var(--text);
  background: var(--surface-3);
}

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

.meter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #101112;
}

.meter div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 180ms ease;
}

#progressText {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.task-status-message {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1a1b1d;
  color: var(--muted);
  font-size: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stats div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1a1b1d;
}

.stats span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
}

.stats strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-section {
  min-height: 0;
}

.file-list {
  display: grid;
  gap: 6px;
}

.file-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px repeat(2, 64px);
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.file-toolbar input,
.file-toolbar select,
.file-toolbar button {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  color: var(--text);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  outline: none;
}

.file-toolbar button {
  color: #08110f;
  background: var(--accent);
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.file-toolbar input:focus,
.file-toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(24, 169, 153, 0.16);
}

.file-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  color: var(--text);
  background: #1a1b1d;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.file-item:hover,
.file-item.playing {
  border-color: var(--accent);
  background: #202625;
}

.file-item[data-kind="file"] {
  opacity: 0.82;
}

.file-item strong b {
  display: inline-block;
  min-width: 42px;
  margin-right: 7px;
  padding: 2px 5px;
  border-radius: 4px;
  color: #061311;
  background: var(--accent);
  font-size: 10px;
  text-align: center;
}

.file-item[data-kind="file"] strong b {
  color: var(--text);
  background: var(--surface-3);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 48px;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 32px var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(228, 91, 91, 0.65);
}

.toast.warning {
  border-color: rgba(242, 184, 75, 0.65);
}

.file-check {
  display: grid;
  place-items: center;
}

.file-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.file-play {
  height: 28px;
  min-width: 44px;
  border-radius: 5px;
  color: #061311;
  background: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.file-meter {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #101112;
}

.file-meter em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.file-kind {
  color: var(--accent);
  font-size: 13px;
  text-align: right;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  background: #101112;
  color: var(--subtle);
  font-size: 12px;
}

.statusbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.storage-info span {
  min-width: 0;
}

.storage-info button {
  flex: 0 0 auto;
  height: 24px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--text);
  background: var(--surface-3);
  cursor: pointer;
}

#statusText[data-type="error"] {
  color: var(--danger);
}

#statusText[data-type="warning"] {
  color: var(--accent-2);
}

.modal-overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  padding: 18px;
  background: rgba(7, 8, 9, 0.78);
}

.modal-overlay {
  place-items: center;
}

.drawer-overlay {
  justify-items: end;
  align-items: stretch;
  padding: 0;
}

.modal-panel,
.drawer-panel {
  width: min(100%, 760px);
  max-height: min(760px, 92vh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 60px var(--shadow);
}

.drawer-panel {
  width: min(100%, 540px);
  height: 100%;
  max-height: none;
  border-width: 0 0 0 1px;
  border-radius: 0;
}

.modal-panel header,
.drawer-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-panel h2,
.modal-panel h3,
.drawer-panel h2,
.drawer-panel h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.modal-panel h3,
.drawer-panel h3 {
  font-size: 14px;
}

.modal-panel button,
.drawer-panel button {
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: #08110f;
  background: var(--accent);
  font-weight: 650;
  cursor: pointer;
}

.modal-panel header button,
.drawer-panel header button {
  color: var(--text);
  background: var(--surface-3);
}

.modal-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 16px;
}

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

.modal-form.compact {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px 90px;
}

.modal-form label,
.modal-section {
  display: grid;
  gap: 7px;
}

.modal-form label {
  color: var(--muted);
  font-size: 12px;
}

.modal-form input,
.modal-form select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  color: var(--text);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.modal-form input:focus,
.modal-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 169, 153, 0.18);
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.modal-list,
.log-list {
  display: grid;
  gap: 6px;
}

.modal-list span,
.log-list span {
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--muted);
  background: #1a1b1d;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  background: #1a1b1d;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.user-row span {
  padding: 0;
  background: transparent;
  border: 0;
}

.user-row button {
  height: 28px;
  padding: 0 10px;
  color: var(--text);
  background: var(--danger);
}

.user-row button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.diagnostics-grid span {
  display: grid;
  gap: 4px;
  padding: 10px;
  color: var(--subtle);
  background: #1a1b1d;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.diagnostics-grid strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostics-box {
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: var(--muted);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
  }

  .app-shell {
    grid-template-rows: auto 1fr 34px;
  }

  .workspace {
    grid-template-columns: minmax(320px, 40vw) minmax(0, 1fr);
  }

  .details {
    max-height: 42vh;
  }
}

@media (max-width: 720px) {
  html,
  body {
    min-height: 100%;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100%;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .stage {
    order: -1;
    grid-template-rows: auto auto auto;
  }

  .details-head {
    grid-template-columns: 1fr;
  }

  .queue {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .task-list {
    max-height: none;
    overflow: visible;
  }

  .task-files {
    padding: 0 0 0 12px;
  }

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

  .file-toolbar input {
    grid-column: 1 / -1;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1 1 72px;
  }

  .magnet-form {
    grid-template-columns: 1fr;
  }

  .magnet-form button {
    width: 100%;
  }

  .player-wrap {
    aspect-ratio: 16 / 9;
    min-height: 210px;
    max-height: 62vh;
  }

  .seek-panel {
    grid-template-columns: 48px minmax(0, 1fr) 64px;
    padding: 0 10px;
  }

  .details {
    max-height: none;
    padding: 14px 12px 16px;
  }

  .details h2 {
    white-space: normal;
  }

  .file-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .file-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .file-play {
    flex: 1 1 88px;
  }

  .statusbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    min-height: 42px;
    padding: 7px 12px;
    gap: 3px;
  }

  .statusbar span {
    width: 100%;
  }

  .storage-info {
    justify-content: space-between;
  }

  .storage-info button {
    height: 28px;
  }

  .modal-form,
  .modal-form.compact,
  .diagnostics-grid {
    grid-template-columns: 1fr;
  }

  .drawer-overlay {
    align-items: end;
  }

  .drawer-panel {
    width: 100%;
    height: min(92vh, 760px);
    border-width: 1px 0 0;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  .topbar {
    padding: 10px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .task-item {
    grid-template-columns: 9px minmax(0, 1fr) 62px 12px;
    padding: 10px 8px;
  }

  .task-files {
    margin-bottom: 8px;
    padding-left: 6px;
  }

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

  .file-item {
    padding: 8px;
  }

  .toast-stack {
    right: 10px;
    bottom: 58px;
    width: calc(100vw - 20px);
  }

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

@media (max-width: 720px) {
  .topbar {
    gap: 8px;
    padding: 8px 10px 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    font-size: 11px;
  }

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

  .magnet-form input {
    grid-column: 1 / -1;
    height: 36px;
    padding: 0 10px;
  }

  .magnet-form button {
    width: 100%;
    height: 36px;
    padding: 0 8px;
    font-size: 13px;
  }

  #logoutButton {
    grid-column: span 2;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .stage {
    display: contents;
  }

  .player-wrap {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 8;
    min-height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
    border-bottom: 1px solid var(--line);
  }

  .seek-panel {
    order: 2;
    min-height: 38px;
  }

  .queue {
    order: 3;
    display: block;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .panel-title {
    height: 38px;
    padding: 0 12px;
  }

  .task-list {
    padding: 8px;
  }

  .details {
    order: 4;
    padding: 12px;
    border-top: 0;
  }

  .details-head {
    gap: 10px;
  }

  .details h2 {
    font-size: 15px;
    line-height: 1.35;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .actions button {
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    font-size: 13px;
  }

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

  .task-files {
    margin: 0 0 8px;
    padding: 0;
  }

  .file-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .file-toolbar input {
    grid-column: 1 / -1;
    height: 34px;
  }

  .file-toolbar button {
    height: 34px;
  }

  .file-item {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .file-item strong {
    white-space: normal;
    line-height: 1.35;
  }

  .file-actions {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .file-play {
    grid-column: 1 / -1;
    height: 40px;
    font-size: 15px;
  }

}
