* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  min-height: 100vh;
  color: #eee;
}
.page { max-width: 560px; margin: 0 auto; padding: 32px 20px 64px; }
.page.editor-open { max-width: 960px; }
header { text-align: center; margin-bottom: 32px; position: relative; }
header h1 { font-size: 2rem; font-weight: 800; }
header p { opacity: 0.7; margin-top: 8px; }
.user-bar { margin-top: 12px; font-size: 0.9rem; opacity: 0.85; }
.user-bar span { margin-right: 12px; }
h2 { font-size: 1.1rem; margin-bottom: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-head h2 { margin-bottom: 0; }
.muted { opacity: 0.6; font-size: 0.85rem; }
.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
label { display: block; margin-bottom: 16px; font-size: 0.9rem; opacity: 0.9; }
input, select {
  display: block; width: 100%; margin-top: 6px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3); color: #fff; font-size: 1rem;
}
button {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(90deg, #fe2c55, #ff6b35);
  color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row button { flex: 1; }
.btn-secondary {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-small {
  width: auto; padding: 6px 14px; font-size: 0.85rem;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
}
.btn-link {
  width: auto; padding: 4px 10px; font-size: 0.85rem;
  background: transparent; border: 1px solid rgba(255,255,255,0.25);
}
.btn-danger { background: rgba(255,80,80,0.25) !important; border: 1px solid rgba(255,80,80,0.4) !important; }
.draft-list { list-style: none; }
.draft-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.draft-item:last-child { border-bottom: none; }
.draft-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.draft-info strong { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-actions { display: flex; gap: 6px; flex-shrink: 0; }
.draft-actions button { width: auto; padding: 6px 10px; font-size: 0.8rem; }
.user-list { list-style: none; margin-top: 16px; }
.user-list li {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.9rem;
}
.user-list li:last-child { border-bottom: none; }
.role-badge {
  font-size: 0.75rem; padding: 2px 8px; border-radius: 6px;
  background: rgba(254,44,85,0.25); margin-left: 8px;
}
.admin-form { margin-bottom: 8px; }
.hidden { display: none !important; }
.checkbox { display: flex !important; align-items: center; gap: 10px; }
.checkbox input { width: auto; margin: 0; }
.error { color: #ff6b6b; margin-top: 12px; }
.warn { color: #ffb347; margin-top: 8px; font-size: 0.85rem; }
#preview { width: 100%; border-radius: 12px; margin-top: 16px; background: #000; }
.progress-bar {
  height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px;
  margin-top: 12px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #fe2c55, #ff6b35);
  border-radius: 4px; transition: width 0.3s ease;
}
.progress-fill.indeterminate {
  width: 30% !important; animation: pulse 1.2s ease-in-out infinite;
}
.task-list { list-style: none; }
.task-item {
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.task-item:last-child { border-bottom: none; }
.task-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.task-head strong { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-status { font-size: 0.8rem; flex-shrink: 0; opacity: 0.85; }
.task-status.done { color: #6ee7a0; }
.task-status.failed { color: #ff6b6b; }
.task-status.warn { color: #ffb347; }
.task-meta { font-size: 0.8rem; opacity: 0.6; margin-top: 6px; }
.task-item .progress-bar { margin-top: 8px; }
.task-preview { width: 100%; border-radius: 8px; margin-top: 10px; background: #000; }
.task-actions { margin-top: 8px; display: flex; gap: 8px; }
.task-actions button { width: auto; padding: 6px 12px; font-size: 0.8rem; }
.editor-layout {
  display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 16px;
}
@media (min-width: 768px) {
  .editor-layout { grid-template-columns: 320px 1fr; align-items: start; }
}
.editor-preview {
  background: #000; border-radius: 12px; overflow: hidden; min-height: 200px;
}
#previewMount { width: 100%; }
.editor-controls label { margin-bottom: 14px; }
.editor-section-block { margin-bottom: 20px; }
.editor-section-title {
  font-size: 0.95rem; margin-bottom: 12px; opacity: 0.9;
  padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.asset-group { margin-bottom: 16px; }
.asset-label { font-size: 0.85rem; opacity: 0.75; margin-bottom: 8px; }
.photo-asset-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.photo-asset-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: 10px; background: rgba(0,0,0,0.25);
}
.photo-asset-item img {
  width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0;
}
.photo-asset-item .photo-index { font-size: 0.75rem; opacity: 0.6; width: 20px; text-align: center; flex-shrink: 0; }
.photo-asset-actions { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.photo-asset-actions button {
  width: auto; padding: 4px 8px; font-size: 0.75rem;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
}
.photo-asset-actions button.btn-danger-asset {
  background: rgba(255,80,80,0.2); border-color: rgba(255,80,80,0.35);
}
.btn-add-asset {
  display: block; text-align: center; padding: 10px; border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.25); cursor: pointer; font-size: 0.85rem;
  opacity: 0.85; margin-bottom: 0;
}
.btn-add-asset:hover { border-color: rgba(254,44,85,0.5); opacity: 1; }
.logo-asset-preview img { max-width: 80px; max-height: 80px; border-radius: 8px; margin-bottom: 8px; }
.music-asset-preview audio { width: 100%; margin-bottom: 8px; }
.editor-param { margin-bottom: 12px; }
.editor-param .param-value { float: right; opacity: 0.7; font-size: 0.85rem; }
.editor-param input[type=range] { width: 100%; margin-top: 6px; accent-color: #fe2c55; }
@keyframes pulse { 0%,100% { width: 20%; margin-left: 0; } 50% { width: 60%; margin-left: 20%; } }
.tag { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; background: #fe2c55; margin-left: 8px; }
