:root {
  --bg: #0b0f14;
  --surface: #121820;
  --surface-2: #1a2230;
  --border: #2a3545;
  --text: #e8edf4;
  --text-muted: #8b99ad;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  width: 100%;
}

#app {
  width: 100%;
}

.hidden { display: none !important; }

.en-num {
  font-variant-numeric: tabular-nums lining-nums;
  unicode-bidi: isolate;
}

.view {
  min-height: 100vh;
}

/* Login */
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-mark {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 8px 24px rgba(59, 130, 246, 0.35));
}

.logo-mark-sm {
  width: 40px;
  height: 40px;
  margin: 0;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 2vw, 20px) clamp(16px, 2.5vw, 32px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand .logo-mark-sm {
  flex-shrink: 0;
}

.header-brand small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Main — full width */
.main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(16px, 2.5vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
}

#dashboard-view {
  width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 24px);
  width: 100%;
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tab-panel.hidden { display: none; }

.cookies-box {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cookies-box summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookies-box summary::-webkit-details-marker { display: none; }

.cookies-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.cookies-badge.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.cookies-badge.invalid {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.cookies-message {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.cookies-message.hidden { display: none; }

.cookies-hint { margin: 12px 0; }

.cookies-hint code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.cookies-box textarea {
  width: 100%;
  margin: 12px 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.75rem;
  resize: vertical;
}

.source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}

.source-badge.youtube {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.source-badge.gdrive {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.source-badge.ytdlp {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
}

.hint a {
  color: var(--primary);
  text-decoration: none;
}

.hint a:hover {
  text-decoration: underline;
}

.hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  margin-bottom: 0;
}

/* Form */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
}

.select-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.select-input:focus {
  outline: none;
  border-color: var(--primary);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.ytdlp-form .field-wide {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .ytdlp-form {
    grid-template-columns: 2fr 1fr 1fr;
    align-items: end;
  }
  .ytdlp-form .checkbox-field {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
}

@media (min-width: 1100px) {
  .ytdlp-form {
    grid-template-columns: 2fr 1fr 1fr auto;
  }
  .ytdlp-form .checkbox-field {
    grid-column: auto;
    margin-bottom: 0;
    white-space: nowrap;
  }
}

.download-form {
  display: grid;
  gap: 0;
}

@media (min-width: 768px) {
  .download-form {
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
  }
  .download-form .field { margin-bottom: 0; }
  .download-form .btn { height: 42px; white-space: nowrap; }
}

@media (min-width: 1200px) {
  .download-form {
    grid-template-columns: 2fr 1fr auto;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-success {
  background: transparent;
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-success:hover {
  background: rgba(34, 197, 94, 0.1);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: auto;
}

.files-table th,
.files-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.files-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  white-space: nowrap;
}

.files-table .cell-id {
  width: 48px;
  white-space: nowrap;
}

.files-table .cell-source {
  width: 110px;
  white-space: nowrap;
}

.files-table .cell-filename {
  min-width: min(100%, 280px);
  width: 40%;
}

.files-table .cell-size {
  white-space: nowrap;
  width: 120px;
}

.files-table .cell-status {
  white-space: nowrap;
  width: 100px;
}

.files-table .cell-date {
  white-space: nowrap;
  width: 150px;
}

.files-table .cell-actions {
  width: 160px;
}

.files-table tbody tr:hover {
  background: var(--surface-2);
}

.file-name,
.file-name-link {
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.5;
  display: block;
  width: 100%;
  max-width: none;
}

.file-name-link {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  font: inherit;
  text-align: right;
  padding: 0;
}

.file-name-link:hover {
  text-decoration: underline;
}

.file-url {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.45;
  max-width: none;
}

.file-cell-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-pending { background: rgba(139, 153, 173, 0.15); color: var(--text-muted); }
.badge-downloading { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.badge-completed { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Messages */
.error-msg, .msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.msg.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  z-index: 100;
  transition: opacity 0.3s;
}

.toast.show { display: block; opacity: 1; }

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Progress */
.progress-block {
  margin-top: 8px;
  width: 100%;
  min-width: 0;
}

.progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 2%;
}

.progress-fill.indeterminate {
  width: 40% !important;
  animation: progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.progress-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.progress-info strong {
  color: var(--text);
  font-weight: 600;
  font-size: 0.78rem;
}

.progress-detail,
.progress-size {
  display: block;
  word-break: break-word;
}

.file-name-link:hover {
  text-decoration: underline;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.45;
  flex: 1;
  padding-left: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px;
}

/* Audio player */
.player-modal .player-card {
  max-width: 420px;
  padding: 28px 24px 24px;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(59, 130, 246, 0.18) 0%, transparent 55%),
    var(--surface);
}

.player-modal.is-video .player-card {
  max-width: min(920px, 96vw);
  padding: 20px 20px 24px;
}

.player-stage {
  position: relative;
  margin-bottom: 20px;
}

.player-audio-visual {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 8px 0 0;
}

.player-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.player-video-center-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px;
  height: 72px;
  border: none;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.92);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background 0.15s ease;
}

.player-video-center-play svg {
  width: 34px;
  height: 34px;
  margin-right: -3px;
}

.player-video-center-play:hover {
  transform: scale(1.06);
  background: rgba(37, 99, 235, 0.95);
}

.player-modal.is-video.is-playing .player-video-center-play {
  opacity: 0;
  pointer-events: none;
}

.player-video-wrap:is(:fullscreen, :-webkit-full-screen) {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
}

.player-video-wrap:is(:fullscreen, :-webkit-full-screen) .player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-video-wrap:is(:fullscreen, :-webkit-full-screen) .player-video-center-play {
  z-index: 2;
}

.player-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
}

.player-modal.is-video .player-meta {
  margin-bottom: 16px;
}

.player-modal.is-video .player-controls {
  margin-bottom: 14px;
}

.player-disc {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(59, 130, 246, 0.35);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.player-modal.is-playing .player-disc {
  animation: player-spin 8s linear infinite;
}

@keyframes player-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.player-disc-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
}

.player-disc-icon {
  width: 22px;
  height: 22px;
}

.player-visual-glow {
  position: absolute;
  inset: 10% 15%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(20px);
}

.player-meta {
  text-align: center;
  margin-bottom: 22px;
  padding: 0 8px;
}

.player-meta h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.player-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.player-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.player-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  flex-shrink: 0;
}

.player-progress {
  position: relative;
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.player-progress-track,
.player-progress-buffer,
.player-progress-fill {
  position: absolute;
  right: 0;
  left: 0;
  height: 5px;
  border-radius: 999px;
}

.player-progress-track {
  background: var(--surface-2);
}

.player-progress-buffer {
  background: rgba(59, 130, 246, 0.2);
  width: 0%;
}

.player-progress-fill {
  background: linear-gradient(90deg, var(--primary) 0%, #6366f1 100%);
  width: 0%;
  transition: width 0.05s linear;
}

.player-progress-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  transform: translate(50%, -50%);
  right: 0%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.player-progress:hover .player-progress-thumb,
.player-progress.is-dragging .player-progress-thumb {
  opacity: 1;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 18px;
}

.player-btn {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.player-btn:active {
  transform: scale(0.94);
}

.player-btn-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.player-btn-play:hover {
  filter: brightness(1.08);
}

.player-btn-play svg {
  width: 28px;
  height: 28px;
}

.player-btn-play .icon-play {
  margin-right: -3px;
}

.player-btn-secondary {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.player-btn-secondary:hover {
  color: var(--text);
  background: var(--border);
}

.player-btn-secondary svg {
  width: 22px;
  height: 22px;
}

.player-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.player-volume-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.player-volume {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface-2);
  border-radius: 999px;
  outline: none;
}

.player-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.player-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
}

.player-resume {
  text-align: center;
  font-size: 0.78rem;
  color: var(--primary);
  margin: 14px 0 0;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

#player-audio {
  display: none;
}

.player-modal.is-video .player-audio-visual {
  display: none;
}

@media (max-width: 900px) {
  .header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .user-label {
    display: none;
  }

  .files-table thead {
    display: none;
  }

  .files-table,
  .files-table tbody,
  .files-table tr,
  .files-table td {
    display: block;
    width: 100%;
  }

  .files-table tbody tr {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
  }

  .files-table tbody tr:hover {
    background: var(--surface-2);
  }

  .files-table td {
    display: grid;
    grid-template-columns: minmax(72px, 28%) 1fr;
    gap: 8px 12px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 53, 69, 0.6);
  }

  .files-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .files-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  .files-table .cell-filename {
    grid-template-columns: 1fr;
  }

  .files-table .cell-filename::before {
    margin-bottom: 2px;
  }

  .files-table .cell-actions .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .header { padding: 12px 16px; }
  .tabs {
    flex-wrap: wrap;
  }
  .tab {
    flex: 1 1 auto;
    text-align: center;
  }
}
