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

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface2: #f0f0f5;
  --border: #e2e2e8;
  --border2: #d0d0da;
  --accent: #5b4de0;
  --accent-light: #ede9ff;
  --text: #111118;
  --muted: #6b6b80;
  --muted2: #9999aa;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --radius: 14px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Auth ── */
#auth-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0eeff 0%, #f5f5f7 50%, #eef2ff 100%);
  padding: 20px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #5b4de0, #8b7cf8);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0; box-shadow: 0 4px 12px rgba(91,77,224,.3);
}
.logo-text { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.logo-sub  { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -.03em; }
.auth-card > p { color: var(--muted); font-size: 0.875rem; margin-bottom: 28px; }
.error-msg {
  background: var(--danger-bg); border: 1px solid #fca5a5; color: var(--danger);
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: .85rem;
  margin-bottom: 16px; display: none;
}
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 7px; letter-spacing: .02em; text-transform: uppercase; }
input[type="password"], input[type="text"], input[type="search"] {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text);
  font-size: .95rem; margin-bottom: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,77,224,.12); }
input::placeholder { color: var(--muted2); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: none;
  font-size: .875rem; font-weight: 600; cursor: pointer; transition: all .15s;
  letter-spacing: -.01em; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(91,77,224,.3); }
.btn-primary:hover { background: #4a3dc0; box-shadow: 0 4px 12px rgba(91,77,224,.4); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1.5px solid #fca5a5; }
.btn-danger:hover { background: #fecaca; }
.btn-full { width: 100%; padding: 13px; font-size: .95rem; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }

/* ── App Layout ── */
#app { display: none; min-height: 100vh; }
header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 62px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-logo-img { height: 34px; width: auto; }
.header-right { display: flex; align-items: center; gap: 10px; }
.badge {
  background: var(--accent-light); color: var(--accent); border: 1px solid #c4b8ff;
  padding: 3px 10px; border-radius: 20px; font-size: .68rem; font-weight: 700; letter-spacing: .06em;
}
.stat-pill {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px; font-size: .78rem; color: var(--muted);
}
.stat-pill span { color: var(--text); font-weight: 700; }
main { padding: 24px 28px; max-width: 1440px; margin: 0 auto; }

/* ── Path bar ── */
.path-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.breadcrumb {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: .875rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 12px; box-shadow: var(--shadow-sm);
}
.bc-item { color: var(--accent); cursor: pointer; padding: 2px 6px; border-radius: 6px; transition: background .12s; font-weight: 500; }
.bc-item:hover { background: var(--accent-light); }
.bc-item.current { color: var(--text); cursor: default; font-weight: 700; }
.bc-item.current:hover { background: transparent; }
.bc-sep { color: var(--border2); user-select: none; margin: 0 1px; font-size: .8rem; }
.path-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius); padding: 28px 24px;
  text-align: center; cursor: pointer; transition: all .2s; background: var(--surface);
  margin-bottom: 20px; user-select: none; box-shadow: var(--shadow-sm);
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-light); }
.upload-zone.drag-over { border-color: var(--accent); background: var(--accent-light); transform: scale(1.005); box-shadow: var(--shadow-md); }
.upload-icon { font-size: 1.8rem; margin-bottom: 8px; display: block; }
.upload-zone h3 { font-size: .9rem; font-weight: 700; margin-bottom: 4px; }
.upload-zone p { color: var(--muted); font-size: .78rem; }
.upload-zone strong { color: var(--accent); }
#file-input { display: none; }

/* ── Progress ── */
.progress-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 18px; display: none; box-shadow: var(--shadow-sm);
}
.progress-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.progress-item:last-child { margin-bottom: 0; }
.p-name { flex: 1; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; font-weight: 500; }
.p-bar-wrap { flex: 2; background: var(--surface2); border-radius: 4px; height: 5px; overflow: hidden; }
.p-bar { height: 100%; background: var(--accent); border-radius: 4px; transition: width .2s; }
.p-status { font-size: .72rem; color: var(--muted); min-width: 34px; text-align: right; font-weight: 600; }

/* ── Toolbar ── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { flex: 1; min-width: 200px; position: relative; }
.search-wrap input { padding-left: 38px; margin: 0; background: var(--surface); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted2); pointer-events: none; font-size: .85rem; }
.filter-btns, .view-btns { display: flex; gap: 4px; }
.filter-btn {
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm);
}
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(91,77,224,.25); }
.filter-btn:not(.active):hover { background: var(--surface2); color: var(--text); }
.view-btn {
  padding: 8px 11px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1rem;
  transition: all .15s; box-shadow: var(--shadow-sm);
}
.view-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Section labels ── */
.section-label {
  font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 10px; margin-top: 4px; padding-left: 2px;
}

/* ── Grid ── */
#media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
#media-grid.list-view { grid-template-columns: 1fr; gap: 6px; }

/* ── Folder card ── */
.folder-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: all .18s; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.folder-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #5b4de0, #8b7cf8); opacity: 0; transition: opacity .18s;
}
.folder-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.folder-card:hover::before { opacity: 1; }
.folder-card.drag-target { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px rgba(91,77,224,.2); }
.folder-icon-wrap {
  width: 44px; height: 44px; background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.folder-name { font-size: .875rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* ── Media card ── */
.media-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all .18s; box-shadow: var(--shadow-sm); position: relative;
  cursor: pointer;
}
.media-card:hover { border-color: var(--border2); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.media-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,77,224,.18); }
.media-card[draggable="true"] { cursor: grab; }
.media-card[draggable="true"]:active { cursor: grabbing; }
.select-check {
  position: absolute; top: 9px; left: 9px; width: 22px; height: 22px;
  background: rgba(255,255,255,.92); border: 2px solid var(--border2); border-radius: 6px;
  cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; transition: all .15s; box-shadow: var(--shadow-sm); color: transparent;
}
.media-card:hover .select-check { border-color: var(--accent); }
.media-card.selected .select-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.thumb {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block;
  background: var(--surface2); transition: opacity .15s;
}
.thumb:hover { opacity: .92; }
.thumb-icon {
  width: 100%; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; background: linear-gradient(135deg, var(--surface2), var(--bg));
}
.media-info { padding: 10px 12px 6px; }
.media-name { font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.media-meta { font-size: .7rem; color: var(--muted); display: flex; justify-content: space-between; }
.media-actions { display: flex; gap: 5px; padding: 8px 10px 10px; }
.copy-btn {
  flex: 1; padding: 7px 8px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--text); font-size: .72rem; font-weight: 600;
  cursor: pointer; transition: all .15s; text-align: center;
}
.copy-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.copy-btn.copied { background: var(--success-bg); border-color: #86efac; color: var(--success); }
.del-btn {
  padding: 7px 9px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  background: transparent; color: var(--muted2); font-size: .85rem; cursor: pointer; transition: all .15s;
}
.del-btn:hover { background: var(--danger-bg); border-color: #fca5a5; color: var(--danger); }

/* ── List view ── */
#media-grid.list-view .folder-card { padding: 10px 14px; }
#media-grid.list-view .media-card { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: var(--radius-sm); }
#media-grid.list-view .thumb, #media-grid.list-view .thumb-icon { width: 48px; height: 48px; aspect-ratio: 1; border-radius: 8px; flex-shrink: 0; font-size: 1.4rem; }
#media-grid.list-view .media-info { flex: 1; padding: 0; min-width: 0; }
#media-grid.list-view .media-actions { padding: 0; flex-shrink: 0; }
#media-grid.list-view .select-check { position: static; flex-shrink: 0; }

/* ── Detail Panel (slide-out) ── */
.detail-panel {
  position: fixed; top: 0; right: -480px; width: 460px; max-width: 92vw; height: 100vh;
  background: var(--surface); border-left: 1px solid var(--border); z-index: 500;
  display: flex; flex-direction: column; transition: right .28s cubic-bezier(.22,1,.36,1);
  box-shadow: -8px 0 32px rgba(0,0,0,.1);
  overflow-y: auto;
}
.detail-panel.open { right: 0; }
.detail-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.2); backdrop-filter: blur(2px);
  z-index: 499; display: none;
}
.detail-backdrop.open { display: block; }
.dp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.dp-title { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-preview {
  background: var(--surface2); display: flex; align-items: center; justify-content: center;
  min-height: 200px; max-height: 360px; overflow: hidden; flex-shrink: 0;
}
.dp-preview img { max-width: 100%; max-height: 360px; object-fit: contain; }
.dp-preview video { max-width: 100%; max-height: 360px; }
.dp-preview .dp-file-icon { font-size: 4rem; padding: 40px; }
.dp-meta {
  padding: 16px 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px;
  font-size: .8rem; border-bottom: 1px solid var(--border);
}
.dp-meta .label { color: var(--muted); font-weight: 600; }
.dp-meta .value { color: var(--text); word-break: break-all; }
.dp-section { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dp-section:last-child { border-bottom: none; }
.dp-section-title { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.dp-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* URL copy rows */
.url-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; cursor: pointer; transition: all .12s;
}
.url-row:hover { border-color: var(--accent); background: var(--accent-light); }
.url-row.copied { border-color: #86efac; background: var(--success-bg); }
.url-row .url-label { font-size: .7rem; font-weight: 700; color: var(--muted); min-width: 70px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .04em; }
.url-row .url-value {
  flex: 1; font-size: .72rem; font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.url-row .url-copy { font-size: .68rem; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* Variant rows */
.variant-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all .12s; font-size: .78rem;
}
.variant-row:hover { border-color: var(--accent); background: var(--accent-light); }
.variant-row.copied { border-color: #86efac; background: var(--success-bg); }
.variant-name { font-weight: 700; min-width: 60px; }
.variant-dims { color: var(--muted); font-size: .7rem; flex: 1; }
.variant-copy { color: var(--accent); font-weight: 700; font-size: .68rem; flex-shrink: 0; }

/* ── Context Menu ── */
.context-menu {
  position: fixed; z-index: 3000; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 0; min-width: 200px; box-shadow: var(--shadow-lg);
  display: none;
}
.context-menu.open { display: block; }
.ctx-item {
  padding: 8px 16px; font-size: .82rem; cursor: pointer; transition: background .1s;
  display: flex; align-items: center; gap: 8px;
}
.ctx-item:hover { background: var(--accent-light); color: var(--accent); }
.ctx-danger:hover { background: var(--danger-bg); color: var(--danger); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Bulk bar ── */
.bulk-bar {
  display: none; background: var(--accent); color: #fff; border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: .82rem; font-weight: 600; align-items: center; gap: 10px;
  box-shadow: 0 2px 10px rgba(91,77,224,.35);
}
.bulk-bar.visible { display: flex; }
.bulk-bar .btn-ghost { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.25); }

/* ── Empty / Loading ── */
.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); grid-column: 1/-1; }
.empty-state .ei { font-size: 3.5rem; margin-bottom: 14px; display: block; }
.empty-state h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 6px; font-weight: 700; }
.empty-state p { font-size: .85rem; }
.loading-row {
  grid-column: 1/-1; display: flex; align-items: center; justify-content: center;
  padding: 70px; gap: 12px; color: var(--muted); font-size: .9rem; font-weight: 500;
}
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modals ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px); z-index: 2000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  width: 100%; max-width: 460px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .95rem;
}
.modal-body { padding: 20px; }
.modal-body label { margin-bottom: 8px; }
.modal-body input { margin-bottom: 8px; }
.modal-body code { background: var(--surface2); padding: 2px 7px; border-radius: 5px; font-size: .8rem; color: var(--accent); }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface2); }
.folder-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.folder-suggestion {
  background: var(--surface2); border: 1.5px solid var(--border); border-radius: 6px;
  padding: 5px 11px; font-size: .78rem; cursor: pointer; transition: all .15s;
  color: var(--muted); font-weight: 500;
}
.folder-suggestion:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 18px;
  font-size: .875rem; font-weight: 500; display: flex; align-items: center; gap: 9px;
  z-index: 3000; transform: translateY(80px); opacity: 0;
  transition: all .28s cubic-bezier(.34,1.56,.64,1); box-shadow: var(--shadow-lg);
  pointer-events: none; max-width: 340px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-color: #86efac; }
#toast.error { border-color: #fca5a5; }

/* ── Icon Grid ── */
.icon-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 10px;
}
.icon-option {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
}
.icon-option:hover { border-color: var(--accent); background: var(--accent-light); transform: scale(1.08); }
.icon-option.selected { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px rgba(91,77,224,.15); }

/* ── Kbd ── */
kbd {
  display: inline-block; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px; font-size: .72rem; font-family: 'SF Mono', monospace;
  margin-right: 6px; min-width: 26px; text-align: center;
}

/* ── Analytics Dashboard ── */
.analytics-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.analytics-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.analytics-header h3 { font-size: 1rem; font-weight: 700; }
.analytics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; text-align: center;
}
.stat-card-label { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.stat-card-value { font-size: 1.3rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.analytics-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.breakdown-section h4 { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
.type-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .78rem; }
.type-bar-label { min-width: 60px; font-weight: 600; }
.type-bar-wrap { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.type-bar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.type-bar-count { min-width: 30px; text-align: right; color: var(--muted); font-weight: 600; font-size: .72rem; }
.largest-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: .78rem; }
.largest-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.largest-size { color: var(--muted); font-weight: 600; font-size: .72rem; }
@media (max-width: 700px) { .analytics-breakdown { grid-template-columns: 1fr; } }

/* ── Video thumb overlay ── */
.video-thumb {
  position: relative; flex-direction: column; gap: 8px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}
.video-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.video-play-circle {
  width: 48px; height: 48px; background: rgba(91,77,224,.85); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.3); transition: transform .15s;
  padding-left: 3px;
}
.media-card:hover .video-play-circle { transform: scale(1.12); background: rgba(91,77,224,1); }
.video-label { color: rgba(255,255,255,.7); font-size: .75rem; font-weight: 700; letter-spacing: .06em; z-index: 1; }

/* ── Responsive ── */
@media (max-width: 700px) {
  main { padding: 14px; }
  header { padding: 0 16px; }
  .stat-pill { display: none; }
  #media-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
  .path-bar { flex-direction: column; align-items: flex-start; }
  .auth-card { padding: 30px 24px; }
  .detail-panel { width: 100%; max-width: 100%; }
}
