/* jomijo Editor - the layout: the picture, the transport, the timeline and the add bar on the left, the settings of what
   is selected on the right; on a phone all of it stacked, the settings under the timeline. app.css (shared by every
   app) gives the buttons, fields and dialogs. */
:root { --accent: #22d3ee; --accent-2: #67e8f9; }
html, body.ed { height: 100%; }
body.ed { display: flex; flex-direction: column; overflow: hidden; }
.etop .btn { white-space: nowrap; }
.etop { gap: 8px; padding-top: 8px; padding-bottom: 8px; flex-wrap: nowrap; }
.eico { border-radius: 7px; flex: none; }
.etitle { min-width: 0; width: 260px; flex: 0 1 260px; padding: 6px 10px; border-radius: 10px; font-weight: 700; background: transparent; border: 1px solid transparent; }
.etitle:hover, .etitle:focus { border-color: var(--line); background: var(--panel-2); }
.grow { flex: 1; }
.ib { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 17px; line-height: 1; padding: 0; }
.ib:hover { border-color: var(--muted); } .ib:disabled { opacity: 0.35; cursor: default; }
.ib.sm { width: 32px; height: 32px; font-size: 15px; }
.ib.play { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #032027; border: 0; font-size: 18px; }
.ob { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 700; font-size: 13px; white-space: nowrap; }
.ob:hover { border-color: var(--muted); } .ob:disabled { opacity: 0.35; cursor: default; }
.btn.primary { color: #032027; }
.seg2 { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex-wrap: wrap; }
.seg2 button { background: var(--panel-2); border: 0; padding: 8px 12px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg2 button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 24%, var(--panel-2)); color: var(--ink); }

.ewrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.eleft { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.estage { position: relative; flex: 1; min-height: 160px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #102030, #05080d 75%); }
.eframe { position: relative; background: #000; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55); border-radius: 4px; }
.eframe.grab { touch-action: none; cursor: grab; }
.eframe.grab:active { cursor: grabbing; }
.eframe canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 4px; }
.sel { position: absolute; z-index: 3; border: 2px solid var(--accent); border-radius: 4px; cursor: move; touch-action: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.sel .size { position: absolute; right: -14px; bottom: -14px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 3px solid #05080d; cursor: nwse-resize; touch-action: none; }
.guide { position: absolute; z-index: 2; background: #f472b6; pointer-events: none; } .guide.gx { top: 0; bottom: 0; left: 50%; width: 1px; } .guide.gy { left: 0; right: 0; top: 50%; height: 1px; }
.eempty { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 20px; text-align: center; background: rgba(5, 8, 13, 0.82); }
.eempty p { max-width: 360px; }
body.dropping .estage { outline: 3px dashed var(--accent); outline-offset: -8px; }
.toast { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(12, 17, 36, 0.94); border: 1px solid var(--line); padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; z-index: 6; max-width: min(560px, 90%); text-align: center; }

.transport { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.ttime { font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.zoom { display: inline-flex; gap: 4px; margin-left: 4px; }

/* the timeline: the playhead stays in the middle */
.tl { position: relative; height: 150px; flex: none; background: #0a0f1e; border-top: 1px solid var(--line); }
.tlscroll { position: absolute; inset: 0; overflow: auto; touch-action: pan-x pan-y; scrollbar-width: thin; overscroll-behavior-x: contain; }
.tlinner { position: relative; min-height: 100%; }
.playhead { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; z-index: 5; box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }
.playhead::before { content: ""; position: absolute; top: 0; left: -6px; border: 7px solid transparent; border-top-color: #fff; }
.ruler { position: absolute; left: 0; right: 0; top: 0; height: 22px; border-bottom: 1px solid var(--line); }
.tick { position: absolute; top: 3px; font-size: 10px; color: var(--muted); transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.tick::after { content: ""; position: absolute; left: 50%; top: 14px; height: 5px; width: 1px; background: var(--line); }
.item { position: absolute; border-radius: 8px; overflow: visible; cursor: pointer; user-select: none; -webkit-user-select: none; box-sizing: border-box; }
.item.ov { display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.item.ov .lab { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.item.ov img { height: 24px; width: auto; border-radius: 4px; flex: none; }
.item.text { background: #7c3aed; } .item.image { background: #0e7490; } .item.video { background: #be185d; }
.item.clip { background: #1e293b; border: 1px solid #334155; }
.item.clip .strip { position: absolute; left: 0; right: 0; top: 0; height: 46px; display: flex; overflow: hidden; border-radius: 7px 7px 0 0; pointer-events: none; }
.item.clip .strip img { height: 46px; object-fit: cover; flex: none; opacity: 0.9; }
.item.clip .wave { position: absolute; left: 0; bottom: 0; width: 100%; height: 18px; pointer-events: none; }
.item.clip .lab { position: absolute; left: 6px; top: 3px; font-size: 10px; font-weight: 700; background: rgba(0, 0, 0, 0.6); padding: 1px 5px; border-radius: 5px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.item.clip.muted .wave { opacity: 0.5; }
.item.on { outline: 3px solid #facc15; outline-offset: -1px; z-index: 3; touch-action: none; }
.item .h { position: absolute; top: -2px; bottom: -2px; width: 22px; background: #facc15; touch-action: none; cursor: ew-resize; z-index: 4; }
.item .h.l { left: -20px; border-radius: 8px 0 0 8px; } .item .h.r { right: -20px; border-radius: 0 8px 8px 0; }
.item .h::after { content: ""; position: absolute; left: 50%; top: 30%; bottom: 30%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #3f2d00; }
.dropmark { position: absolute; width: 4px; height: 64px; background: #facc15; border-radius: 2px; z-index: 6; pointer-events: none; }
.tlempty { position: absolute; height: 64px; display: flex; align-items: center; padding: 0 14px; border: 2px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }

.addbar { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.ab { flex: 1 0 auto; min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.ab b { font-size: 20px; line-height: 1.1; } .ab:hover { border-color: var(--accent); color: var(--ink); }

/* the settings */
.eside { border-left: 1px solid var(--line); background: var(--panel); min-width: 0; min-height: 0; overflow-y: auto; padding: 14px 16px 24px; }
.eside h3 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.eside .field { margin-bottom: 12px; }
.eside input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); width: 100%; }
.pnote { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.prow { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chkrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; cursor: pointer; } .chkrow input { width: auto; accent-color: var(--accent); }
.cols { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cdot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.cdot[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.cols input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.times input { width: 100%; }
.bin { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.bin figure { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 11px; }
.bin img { width: 100%; height: 64px; object-fit: cover; display: block; background: #000; }
.bin figcaption { padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bin .bb { display: flex; } .bin .bb button { flex: 1; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 5px 0; font-size: 11px; font-weight: 700; cursor: pointer; color: var(--ink); }
.bin .bb button + button { border-left: 1px solid var(--line); }
.danger, .btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); }
textarea.ttext { min-height: 76px; resize: vertical; font-weight: 700; }

/* dialogs */
.top0 { margin-top: 0; }
.plist { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 8px; }
.plist li { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.plist li.on { border-color: var(--accent); }
.plist .po { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; background: none; border: 0; text-align: left; cursor: pointer; padding: 0; }
.plist img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.plist strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist small { color: var(--muted); }
.exp .st-setup, .exp .st-busy, .exp .st-done, .exp .st-error { display: none; }
.exp[data-state="setup"] .st-setup, .exp[data-state="busy"] .st-busy, .exp[data-state="done"] .st-done, .exp[data-state="error"] .st-error { display: block; }
.bar { height: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

@media (max-width: 1100px) { .ewrap { grid-template-columns: minmax(0, 1fr) 300px; } }
/* a phone (or a narrow window): one column - the picture, the transport, the timeline, the add bar, then the settings */
@media (max-width: 860px) {
  body.ed { overflow: auto; height: auto; } .hide-s, .eico { display: none; }
  .etop { padding-left: 10px; padding-right: 10px; } .etitle { flex: 1 1 auto; width: auto; }
  .ewrap { grid-template-columns: minmax(0, 1fr); } .estage { height: 46vh; height: 46dvh; flex: none; }
  .transport { gap: 4px; padding: 8px; } .zoom, #toStart { display: none; } .ttime { font-size: 11px; margin-left: 0; }
  .transport .ib { width: 34px; height: 34px; } .transport .ib.play { width: 42px; height: 42px; } .transport .ob { padding: 0 9px; }
  .etop .ib { width: 34px; height: 34px; }
  .eside { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}
