/* Minimal overrides — Tailwind handles layout */

.rich-line:empty::before {
  content: attr(data-placeholder);
  color: #64748b;
  pointer-events: none;
}

.rich-line:focus {
  outline: none;
}

/* ── Source card: controls | vertical preview ── */
.source-card {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .source-card {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
  }
}

.source-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.source-card-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Vertical 9:16 trim / preview player */
.trim-player {
  width: 100%;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.trim-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 1rem;
  border: 2px solid #334155;
  background: #000;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

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

/* Native controls sit on the video; allow clicks on the scrubber */
.trim-player-frame.native-controls video {
  pointer-events: auto;
}

.trim-player-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.trim-player-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.trim-player-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.trim-player-btn {
  border-radius: 0.5rem;
  background: #1e293b;
  padding: 0.35rem 0.6rem;
  font-size: 0.7rem;
  color: #cbd5e1;
  border: 1px solid #334155;
  cursor: pointer;
  line-height: 1.2;
}

.trim-player-btn:hover {
  color: #fff;
  border-color: #64748b;
}

.trim-player-btn.primary {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.4);
  font-weight: 600;
}

.trim-player-bounds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.tp-seek-hint {
  font-size: 0.65rem;
  color: #64748b;
  text-align: center;
}

.climax-help {
  font-size: 0.65rem;
  line-height: 1.35;
  color: #64748b;
  margin-top: 0.15rem;
}

.extract-badge {
  display: inline-block;
  border-radius: 0.25rem;
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
}

.trim-badge {
  display: inline-block;
  border-radius: 0.25rem;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
}

.proj-item-row {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.proj-del {
  flex-shrink: 0;
  border-radius: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.7rem;
  color: #f87171;
  opacity: 0.7;
}

.proj-del:hover {
  opacity: 1;
  background: rgba(248, 113, 113, 0.1);
}

/* Phone mockup — mirrors backend 1080×1920 layout scaled down */
.phone-title {
  font-size: 13px;
  line-height: 1.4;
}

.phone-list {
  top: 80px;
}

.phone-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
  font-weight: 800;
}

.phone-row .num {
  flex-shrink: 0;
}

.phone-row .kw {
  letter-spacing: 0.05em;
}

.phone-row.anim-fade {
  animation: phoneFadeIn 0.6s ease both;
}

.phone-row.anim-slide {
  animation: phoneSlideIn 0.5s ease both;
}

@keyframes phoneFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes phoneSlideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* File inputs */
input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: #334155;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background: #475569;
}

@media (max-width: 1279px) {
  #mobilePreviewBar {
    display: block;
  }
}

/* ── Activity panel (full sidebar) ── */
.activity-dock {
  width: 100%;
  height: 100%;
}

.activity-dock--tall {
  min-height: min(70vh, 640px);
}

.activity-dock--tall .activity-dock-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: min(70vh, 640px);
}

.activity-dock-inner {
  border: 1px solid #334155;
  border-radius: 1rem;
  background: rgba(30, 41, 59, 0.85);
  overflow: hidden;
}

.activity-dock-header {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  text-align: left;
  cursor: pointer;
  flex-shrink: 0;
}

.activity-dock-header:hover {
  background: rgba(15, 23, 42, 0.35);
}

.activity-dock-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  border-top: 1px solid #334155;
  padding: 0.5rem 0.75rem 0.75rem;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.activity-dock.collapsed .activity-dock-body {
  display: none;
}

.activity-dock.collapsed #activityChevron {
  transform: rotate(-90deg);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-height: 180px;
  max-height: none;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid #334155;
}

.activity-log {
  flex: 0 0 auto;
  min-height: 160px;
  max-height: 40%;
  overflow-y: auto;
  border-radius: 0.75rem;
  border: 1px solid #334155;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.45;
}

@media (max-width: 1279px) {
  .activity-dock--tall,
  .activity-dock--tall .activity-dock-inner {
    min-height: 420px;
  }
}

/* Player progress */
.xfer-box {
  margin-top: 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid #334155;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.55rem 0.7rem;
}

.xfer-box.hidden {
  display: none;
}

.xfer-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  color: #94a3b8;
}

.xfer-track {
  height: 0.4rem;
  overflow: hidden;
  border-radius: 999px;
  background: #0b1220;
}

.xfer-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #facc15, #f59e0b);
  transition: width 0.15s ease;
}

.xfer-bar.indeterminate {
  width: 40% !important;
  animation: xferSlide 1.1s ease-in-out infinite;
}

@keyframes xferSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

.activity-live-row {
  display: grid;
  gap: 0.25rem;
}

.activity-live-row .xfer-track {
  height: 0.35rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill.ready { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-pill.pending { background: rgba(100, 116, 139, 0.25); color: #94a3b8; }
.status-pill.busy { background: rgba(250, 204, 21, 0.18); color: #facc15; }
.status-pill.failed { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* In-browser generated video preview */
.video-preview-modal::backdrop {
  background: rgba(2, 6, 23, 0.78);
}
.video-preview-modal[open] {
  display: block;
}
