/* Glimra Video – videoredigeraren (samma färgtema C2 som resten av Glimra) */
#view-video { display: flex; flex-direction: column; height: 100vh; --tlh: 300px; --vstage: #1a1115; }
#view-video.v-dropping::after { content: 'Släpp filerna för att lägga till dem'; position: fixed; inset: 10px; border: 3px dashed var(--amber); border-radius: 18px; background: rgba(30, 13, 20, .55); color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 900; pointer-events: none; }
.v-main { flex: 1; display: flex; min-height: 0; }
.v-panel { width: 320px; }
.v-center { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--vstage); }
.v-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.v-frame { position: relative; background: #000; box-shadow: 0 10px 40px rgba(0,0,0,.45); touch-action: none; }
.v-canvas { width: 100%; height: 100%; display: block; }
.v-selbox { position: absolute; left: 0; top: 0; border: 2px solid #9fe7cf; box-shadow: 0 0 0 1px rgba(0,0,0,.35); transform-origin: center center; cursor: move; pointer-events: none; }
.v-selbox .v-sh { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #1d8f6d; pointer-events: auto; }
.v-selbox .v-sh[data-h=se] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.v-selbox .v-rot { left: 50%; top: -30px; transform: translateX(-50%); width: 22px; height: 22px; cursor: grab; display: flex; align-items: center; justify-content: center; color: #1d8f6d; }
.v-selbox .v-rot .ico { pointer-events: none; }
.v-guide { position: absolute; background: #ff4d8d; pointer-events: none; }
.v-guide.gx { left: 50%; top: 0; bottom: 0; width: 1px; }
.v-guide.gy { top: 50%; left: 0; right: 0; height: 1px; }
.v-controls { height: 52px; flex: none; display: flex; align-items: center; padding: 0 14px; color: #f3e9ed; background: #22161b; border-top: 1px solid #33222a; }
.v-controls .v-cl, .v-controls .v-cr { flex: 1; display: flex; align-items: center; }
.v-controls .v-cr { justify-content: flex-end; }
.v-controls .icon-btn { color: #e8dbe1; }
.v-controls .icon-btn:hover { background: rgba(255,255,255,.1); }
.v-controls .icon-btn.active { color: #9fe7cf; background: rgba(159, 231, 207, .14); }
.v-cbtns { display: flex; align-items: center; gap: 4px; }
.v-play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: linear-gradient(120deg, #5fd1ab 0%, #9fe7cf 100%); color: #4d0c22; display: flex; align-items: center; justify-content: center; margin: 0 6px; box-shadow: 0 4px 14px rgba(29, 143, 109, .35); }
.v-play:hover { filter: brightness(1.06); }
.v-time { font-variant-numeric: tabular-nums; font-size: 13px; color: #b9a7af; }
.v-time b { color: #fff; font-weight: 600; }
.v-props { width: 300px; }
.v-props h4 .btn { text-transform: none; letter-spacing: 0; }
.v-ph { display: flex; align-items: center; gap: 2px; margin: -2px -4px 10px 0; }
.v-ph-t { font-weight: 700; font-size: 15px; }
.v-ph .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-warn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 9px; background: #fff4e5; color: #8a4b00; font-size: 12.5px; margin-bottom: 10px; }
.v-steps { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.v-fmts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.v-fmt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; font-size: 12px; font-weight: 600; }
.v-fmt .box { height: 26px; max-width: 40px; border: 2px solid currentColor; border-radius: 3px; color: var(--muted); }
.v-fmt.active { border-color: var(--accent); background: var(--accent-l); color: var(--accent-d); }
.v-fmt.active .box { color: var(--accent); }
.v-prog { height: 8px; border-radius: 8px; background: #f1e8ec; overflow: hidden; margin: 8px 0; }
.v-prog .fill { height: 100%; width: 0; background: linear-gradient(90deg, #a8284f, #5fd1ab); transition: width .15s; }
.v-pct { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.v-keys td { padding: 5px 10px 5px 0; font-size: 13.5px; }
.v-keys kbd { margin: 0; padding: 2px 7px; border: 1px solid var(--line2); border-radius: 6px; background: #faf6f8; color: var(--text); font-size: 12px; }
.v-rec { text-align: center; padding: 10px 0; }
.v-rec-dot { width: 18px; height: 18px; border-radius: 50%; background: #e11d48; margin: 0 auto 10px; animation: vpulse 1s ease-in-out infinite; }
.v-rec-clock { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes vpulse { 50% { opacity: .35; transform: scale(.85); } }
.v-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.v-page { border: 2px solid transparent; border-radius: 10px; background: #f6f2f4; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.v-page img { max-width: 100%; max-height: 120px; box-shadow: var(--shadow-s); }
.v-page.sel { border-color: var(--accent); background: var(--accent-l); }

/* Mediapanelen */
.v-media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.v-mt { cursor: pointer; min-width: 0; }
.v-mt-img { position: relative; aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; background: #efe9ec; display: flex; align-items: center; justify-content: center; transition: box-shadow .12s; }
.v-mt:hover .v-mt-img { box-shadow: 0 0 0 2px var(--accent); }
.v-mt-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-mt-wave { position: absolute; inset: 0; width: 100%; height: 100%; }
.v-mt-ico { position: relative; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-s); }
.v-mt-dur { position: absolute; right: 5px; bottom: 5px; font-size: 10.5px; font-weight: 600; color: #fff; background: rgba(20, 10, 15, .72); padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.v-mt-used { position: absolute; left: 5px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: #1f9e78; color: #fff; display: flex; align-items: center; justify-content: center; }
.v-mt-miss { position: absolute; left: 5px; bottom: 5px; font-size: 10.5px; font-weight: 700; color: #fff; background: #dc2626; padding: 1px 6px; border-radius: 5px; }
.v-mt.missing img { filter: grayscale(1) opacity(.5); }
.v-mt-add { position: absolute; right: 5px; top: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #fff; color: var(--accent-d); display: flex; align-items: center; justify-content: center; opacity: 0; box-shadow: var(--shadow-s); transition: opacity .12s; }
.v-mt:hover .v-mt-add { opacity: 1; }
.v-mt-name { font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #3b3752; }
.v-arow { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 4px; border-radius: 9px; border: 1px solid var(--line); margin-bottom: 6px; cursor: pointer; background: #fff; }
.v-arow:hover { border-color: var(--accent); }
.v-arow .an { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-tstyles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.v-ts { height: 76px; border-radius: 10px; border: 2px solid transparent; background: radial-gradient(ellipse at 20% 20%, #5b2a3d, #24141b 70%); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 6px; }
.v-ts:hover { border-color: #9fe7cf; }
.v-trgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.v-tr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; font-weight: 500; }
.v-tr .ico-b { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-l); color: var(--accent-d); display: flex; align-items: center; justify-content: center; }
.v-tr:hover:not(:disabled) { border-color: var(--accent); }
.v-tr.active { border-color: var(--accent); background: var(--accent-l); }
.v-tr.active .ico-b { background: var(--accent); color: #fff; }
.v-tr:disabled, .v-fl:disabled { opacity: .45; cursor: default; }
.v-fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.v-fl { border: 2px solid transparent; border-radius: 9px; padding: 0; background: #f6f2f4; overflow: hidden; font-size: 11px; font-weight: 500; }
.v-fl canvas { width: 100%; aspect-ratio: 3 / 2; display: block; background: #2a1b22; }
.v-fl span { display: block; padding: 4px 0; }
.v-fl.active { border-color: var(--accent); }
.v-fl:hover:not(:disabled) { border-color: #d6bcc7; }

/* Tidslinjen */
.v-resizer { height: 6px; flex: none; cursor: ns-resize; background: var(--line); position: relative; }
.v-resizer::after { content: ''; position: absolute; left: 50%; top: 2px; width: 40px; height: 2px; margin-left: -20px; border-radius: 2px; background: #c9b8bf; }
.v-resizer:hover { background: #e3d6dc; }
.v-tl { height: var(--tlh); flex: none; display: flex; flex-direction: column; background: #fff; min-height: 0; }
.v-tl-bar { height: 44px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.v-tl-bar .icon-btn { width: 34px; height: 34px; }
.v-tl-bar input[type=range] { max-width: 120px; }
.v-tl-bar .cb { height: 32px; padding: 0 10px; border-radius: 8px; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; color: var(--muted); }
.v-tl-bar .cb.active { background: var(--accent-l); color: var(--accent-d); }
.v-tl-hint { font-size: 12px; color: var(--faint); margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-tl-scroll { flex: 1; overflow: auto; position: relative; background: #faf7f8; touch-action: pan-x pan-y; }
.v-tl-inner { position: relative; min-height: 100%; padding-bottom: 20px; }
.v-ruler-row { position: sticky; top: 0; z-index: 6; display: flex; height: 26px; background: #fff; border-bottom: 1px solid var(--line); }
.v-corner { width: var(--vhead, 148px); flex: none; position: sticky; left: 0; background: #fff; z-index: 2; border-right: 1px solid var(--line); }
.v-ruler { flex: 1; position: relative; cursor: pointer; background-image: linear-gradient(90deg, #ddd1d6 1px, transparent 1px); background-repeat: repeat-x; background-position: 0 100%; }
.v-ruler .tick { position: absolute; top: 0; height: 100%; border-left: 1px solid #c9b8bf; padding-left: 4px; font-size: 10.5px; color: var(--muted); line-height: 16px; font-variant-numeric: tabular-nums; pointer-events: none; }
.v-tracks { padding-top: 6px; }
.v-row { display: flex; margin-bottom: 5px; }
.v-head { width: var(--vhead, 148px); flex: none; position: sticky; left: 0; z-index: 4; background: #faf7f8; display: flex; align-items: center; gap: 4px; padding: 0 4px 0 10px; border-right: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.v-head .ti { color: var(--faint); display: flex; }
.v-head .tn { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.v-head .icon-btn { width: 22px; height: 22px; color: var(--faint); border-radius: 6px; }
.v-head .icon-btn.on { color: var(--danger); }
.v-row-main .v-head { color: var(--accent-d); }
.v-lane { flex: 1; position: relative; }
.v-row.drop .v-lane { background: rgba(95, 207, 169, .14); border-radius: 6px; }
.v-row.hidden-track .v-lane { opacity: .45; }
.v-row-main .v-lane { background: rgba(138, 28, 60, .035); border-radius: 6px; }
.v-empty { position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; pointer-events: none; }
.v-empty span { overflow: hidden; text-overflow: ellipsis; }
.v-clip { position: absolute; top: 0; bottom: 0; border-radius: 7px; overflow: hidden; cursor: grab; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); background: #3a2630; touch-action: none; }
.v-clip.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--accent); z-index: 3; }
.v-clip .strip { position: absolute; inset: 2px 0; pointer-events: none; opacity: .95; }
.v-clip .lab { position: absolute; left: 6px; top: 3px; right: 14px; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; pointer-events: none; }
.v-clip .lab span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.v-clip .lab .badge { flex: none; background: rgba(0,0,0,.55); border-radius: 4px; padding: 0 4px; font-size: 10px; display: inline-flex; align-items: center; }
.v-clip .lab .badge.warn { background: #dc2626; }
.v-clip .hl, .v-clip .hr { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 2; }
.v-clip .hl { left: 0; } .v-clip .hr { right: 0; }
.v-clip.sel .hl, .v-clip.sel .hr { background: #fff; }
.v-clip.sel .hl::after, .v-clip.sel .hr::after { content: ''; position: absolute; left: 4px; top: 50%; width: 2px; height: 14px; margin-top: -7px; border-radius: 2px; background: var(--accent); }
.v-clip .wave { position: absolute; left: 0; bottom: 2px; pointer-events: none; }
.v-clip .wave.mini { bottom: 2px; opacity: .9; }
.v-clip .fade { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.v-clip .fade.fi { left: 0; background: linear-gradient(to bottom right, rgba(0,0,0,.45) 50%, transparent 50%); }
.v-clip .fade.fo { right: 0; background: linear-gradient(to bottom left, rgba(0,0,0,.45) 50%, transparent 50%); }
.v-k-text { background: linear-gradient(120deg, #a8284f, #6b1430); }
.v-k-text .lab { top: 50%; transform: translateY(-50%); }
.v-k-audio { background: #bfeedd; }
.v-k-audio .lab { color: #12493a; text-shadow: none; }
.v-t-overlay { box-shadow: inset 0 0 0 2px #b23a5e; }
.v-clip.missing { background: repeating-linear-gradient(45deg, #5b2a3d, #5b2a3d 8px, #3a1a2c 8px, #3a1a2c 16px); }
.v-trans { position: absolute; left: -1px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 6px; border: 0; padding: 0; background: rgba(255,255,255,.92); color: var(--accent-d); display: flex; align-items: center; justify-content: center; z-index: 4; box-shadow: 0 1px 4px rgba(0,0,0,.35); opacity: .85; }
.v-trans:hover { opacity: 1; transform: scale(1.1); }
.v-trans.on { background: var(--accent); color: #fff; }
.v-ovl { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.28) 4px, transparent 4px, transparent 8px); pointer-events: none; }
.v-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: #e11d48; z-index: 7; pointer-events: none; }
.v-playhead .knob { position: sticky; top: 0; width: 14px; height: 18px; margin-left: -6px; background: #e11d48; border-radius: 3px 3px 7px 7px; pointer-events: auto; cursor: ew-resize; }
.v-marker { position: absolute; top: 26px; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: #1d8f6d; z-index: 8; pointer-events: none; }
.v-tl.dragging .v-clip { cursor: grabbing; }
/* Aviseringar visas överst i videovyn så att de inte täcker tidslinjen */
body.v-open #toasts { bottom: auto; top: 66px; }
