* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "Heebo", Arial, sans-serif;
  background: #0e1526; color: #eef2fa;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 900px; margin: 0 auto; padding: 10px 12px 40px; display: flex; flex-direction: column; gap: 12px; }

#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; background: #14213d; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-size: 1.05rem; }
.top-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.btn {
  border: none; border-radius: 10px; padding: 10px 16px;
  font-size: .95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; color: #fff; background: #1b6ef3; text-decoration: none;
  display: inline-block; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn-secondary { background: #24335c; }
.btn-danger { background: #d93025; }
.btn-small { padding: 8px 11px; font-size: .82rem; }
.btn:disabled { opacity: .45; cursor: default; }

/* במה */
#stage-wrap {
  position: relative; background: #000; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 220px;
}
#stage { width: 100%; height: auto; display: block; }
#empty-state {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  padding: 24px; color: #9fb2d8; font-size: .9rem;
}
.empty-title { font-size: 1.3rem; color: #fff; font-weight: 700; }

/* נגן */
#transport { display: flex; align-items: center; gap: 10px; }
.icon-big {
  background: #1b6ef3; color: #fff; border: none; border-radius: 50%;
  width: 44px; height: 44px; font-size: 1.1rem; cursor: pointer; flex: none;
}
#seek { flex: 1; accent-color: #1b6ef3; }
#time-label { font-size: .78rem; color: #9fb2d8; direction: ltr; flex: none; }

/* ציר זמן */
#timeline { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; }
.clip-card {
  flex: none; width: 108px; border-radius: 10px; overflow: hidden;
  background: #1a2440; border: 2px solid transparent; cursor: pointer;
}
.clip-card.sel { border-color: #1b6ef3; }
.clip-card img { width: 100%; height: 60px; object-fit: cover; display: block; background:#000; }
.clip-card .ci { padding: 4px 6px; font-size: .68rem; color: #cfd9ef; }
.clip-card .ci b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* פאנלים */
.panel { background: #14213d; border-radius: 14px; padding: 12px 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.ce-actions { display: flex; gap: 6px; }
.ce-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ce-grid label { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; color: #9fb2d8; }
.ce-grid input[type="range"] { accent-color: #1b6ef3; }
.ce-grid select, .dlg-grid select, .dlg-grid input {
  background: #0e1526; color: #fff; border: 1px solid #24335c; border-radius: 8px;
  padding: 8px; font-family: inherit; font-size: .9rem;
}
.ce-mute { flex-direction: row !important; align-items: center; gap: 8px !important; }

/* טקסטים */
.text-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #0e1526; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px;
  font-size: .85rem;
}
.text-row .tr-meta { color: #9fb2d8; font-size: .72rem; }

/* דיאלוגים */
dialog {
  border: none; border-radius: 16px; background: #14213d; color: #eef2fa;
  padding: 20px; width: min(430px, 92vw); margin: auto;
}
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h3 { margin-bottom: 14px; }
.dlg-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.dlg-grid label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: #9fb2d8; justify-content: space-between; }
.dlg-grid input[type="number"] { width: 80px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
#ex-progress progress { width: 100%; height: 10px; accent-color: #1b6ef3; }
#ex-status { font-size: .85rem; color: #9fb2d8; margin-bottom: 10px; }
#ex-video { width: 100%; border-radius: 10px; background: #000; }

.toast {
  position: fixed; bottom: 26px; right: 50%; transform: translateX(50%);
  background: #eef2fa; color: #14213d; padding: 10px 18px; border-radius: 999px;
  font-size: .88rem; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

@media (max-width: 560px) {
  .ce-grid { grid-template-columns: 1fr; }
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1; }
}
